Verse Library verse

01 Fragment

Resolves common component compilation errors and deprecated API usage.

verse-library/verse-scene-graph-entities-components/01-fragment.verse

Looking at the errors:

1. `component` is unknown  need `using { /Verse.org/SceneGraph }`
2. `using { /UnrealEngine.com/Temporary/SceneGraph }` is deprecated  replace with `/Verse.org/SceneGraph`
3. `<final_super>` requires a base class  `component` is the base class, which will be fixed by the correct using
4. `OnSimulate` doesn't exist on `component` — looking at the KB, the correct override method is `OnBeginSimulation`
5. `Entity` is unknown — in a component, the entity is accessed via `GetEntity()` or similar; looking at the KB pattern, `component` has a method to get the owning entity. The correct approach is to get the entity via the component's built-in `entity` field. From the KB, components have `GetEntity()` - but the closest pattern shown is that `entity` methods include `Hide()` and `Show()`. The component base class provides access to its entity. Based on standard Verse SceneGraph API, the entity is accessed via `GetEntity[]` on the component.

Also, `OnBeginSimulation` signature from KB shows `(): void` (no `<suspends>`). The async loop needs to be spawned inside `OnBeginSimulation`.

Comments

    Sign in to vote, comment, or suggest an edit. Sign in