Any suggestions to check if an entity is inside the room

hey there there i am again I would love to know ur suggestion of an check for somethink to check if its inside an object or room or chunk anny ideas ?

here is one that i had is check the distance

thank you for reading i look out for ur suggestion!

Hi @Timme_Kingma! You can indeed use a distance check from the middle of the room. You can also use triggers to achieve this.

https://developer.playcanvas.com/en/user-manual/physics/trigger-volumes/

1 Like

ive tryed this aproch but because i procedual generate somethink the trigger wont work properly

Hi @Timme_Kingma,

Even if your room is procedural, you can still calculate the total room volume by adding each aabb (bounding box) of your geometry.

That way you can calculate the size of the trigger volume.

If you inspect the orbit-camera script found in the model viewer template, you will see it does something similar to frame the camera around the geometry.

1 Like