03-13-2025 10:06 AM
There are a number of "setter methods" for SceneObject, but I am not finding where the corresponding "getter methods" are.
e.g. getName(), getPosition(), getRotation(), isVisible(), etc...
03-19-2025 03:28 PM
Hi, we don't provide those getter APIs, however if you used an entity to create your SceneObject by attaching a Mesh component, you can get the Transform and Visible components of that entity to get the values of the SceneObject. Here's an example:
val myEntity = Entity.create(Mesh(Uri.parse("example.glb")), Transform(Pose(Vector3(1f, 2f, 3f))), Visible())
// This will create a SceneObject
// Sometime later (at least one tick)
val mySceneObject = systemManager.findSystem<SceneObjectSystem>().getSceneObject(myEntity)
val myTransform = myEntity.getComponent<Transform>().transform
val myPosition = myTransform.t
val myRotation = myTransform.q
val myVisible =myEntity.getComponent<Visible>()
// example of changing isVisible to false
myVisible.isVisible = false
myEntity.setComponent(myVisible)
Hopefully this answers your question. Let me know if you need any more help