- Home /
how to Detect in wich Room the Player is
I have a main Camera with a public Transform input for which Room the player is in (don't worry about what this means exactly). so I want the input to change the object (from which it's getting its transform) depending on which room the player is in. I have a Box setup for every Room (it's encasing every Room) so is there a way to say: if Player is inside the Box of RoomOne change public input to RoomOne?
Answer by Marioooo · Feb 04, 2020 at 05:49 PM
Hello! you can attach a box collider to the box that the player is entering in... check the IsTrigger option and use OnTriggerEnter funcion..
https://docs.unity3d.com/ScriptReference/Collider.OnTriggerEnter.html
hope this helps
but if I add a box collider the player interacts with it... is there a way to stop that?
ok I figured out you can just check is Trigger on the collider
Your answer
Follow this Question
Related Questions
clamping camera movement to map size and camera corners 0 Answers
How can I set up cameras to track the player from room to room? 1 Answer
Cinema 4D camera-movement doesn't work in Unity 0 Answers
Best way to make camera follow player 1 Answer
Is there an elegant way of limiting camera's position? 1 Answer