Forum Discussion

🚨 This forum is archived and read-only. To submit a forum post, please visit our new Developer Forum. 🚨
waynecochran's avatar
1 year ago
Solved

Scale component has no effect on SceneObject stored in an Entity

I am able to create SceneObject's that end up being contained within a specific entity as follows val fooObject = SceneObject(scene, fooMesh, "foo", entity = fooEntity) I am able to call setPos...
  • dav-s's avatar
    1 year ago

    Hi!

    Apologies for the confusion. One thing you need to make sure you do (which is often omitted from our custom SceneObject examples) is attaching it to the SceneObjectSystem. This makes it fully linked in the ECS and other Kotlin systems can grab the SceneObject (like controlling the Visible or Scale components). 

    systemManager
    .findSystem<SceneObjectSystem>()
    .addSceneObject(
    fooEntity,
    CompletableFuture<SceneObject>().apply { complete(fooObject) })

    We use a future here to allow you to do async loading or waiting on object loads.

    Hope this helps!