- Home /
Detect if player is in structure (or in range)
Hi. I am creating a video game called "Kianate", which is for space exploration, and the Beta version is suppost to be run by the arrow keys & wasd, for pc. WASD will control the player, arrow keys control the ship. I need to find a way to make it so that the arrow keys only work when the player is inside the ship's bridge. I need to find a way to detect if the playerobject is in the ship_bridge object. I could do that by figuring if its in the structure, or just in range of the rooms chandelier. is there any way to do this?
Answer by AdrellaDev · Apr 14, 2019 at 01:01 AM
The simplest way would be to put a collider around the room or colliders at the points of entry to the room and use OnTriggerEnter to enable the arrow keys when the player enters the room/collider. And then it disables the arrow keys on exit.
Hmm... that may work. I will have to try it. Thanks for the answer.