Forum Discussion
waynecochran
8 months agoProtege
Looking for getter methods for SceneObject's
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...
1 Reply
Replies have been turned off for this discussion
- NotBadBMeta Employee
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
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
- 4 years ago