Forum Discussion
waynecochran
1 year agoProtege
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...
- 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!
dav-s
1 year agoMeta Employee
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!
waynecochran
1 year agoProtege
I am still not sure how the sceneObject gets fully linked to the ECS system.
Something must be done in the lambda below that associates sceneObject with fooEntity ... what does the complete () function do in this case? i.e. what is suppose to be done in the code marked XXXX below?
val fooEntity = Entity.create(
listOf(
TransformParent(fooParentEntity),
identityScale,
identityPose
)
)
val sceneObject = SceneObject(scene, fooMesh, "foo", entity = fooEntity)
sceneObjectSystem.addSceneObject(
fooEntity,
CompletableFuture<SceneObject>.apply {
// XXXX sceneObject XXXX
}
)
Quick Links
- Horizon Developer Support
- Quest User Forums
- Troubleshooting Forum for problems with a game or app
- Quest Support for problems with your device
Other Meta Support
Related Content
- 3 years ago