- Home /
How do you make an object appear and disappear depending on position of player?
I'm making a maze game. My goal is when you stand on one path and look at a path next to the path your on. That you can't see the game-objects or players that are on the path unless you are standing on that specific path. How can you make this happen? Thank you in advance if you know or don't know the answer to this.
do not quite understand what you want, correct me if I'm wrong; tiens say three roads with objects and npc ..... ......... but only one would be the correto ... say that the first way .......... your idea would look back when being in the wrong way, you can not see objects is the way something like ...... for I do not understand your target well
I forgive my English I'm using an online translator
Answer by Cynikal · Aug 10, 2016 at 02:20 PM
If you're wanting to block out game objects from the view of the camera, you should look into occlusion culling.
You could raycast to determine which path you are on, then display the items.
You could even boxcast(or spherecast), then enable models in front of you. (Empty GameObject, with a Collider, then use that to enable the mesh/scripts/etc)
Your answer
Follow this Question
Related Questions
Trying to get a VR Gun Raycast to work 1 Answer
How can I add the OnTriggerEnter function to all game objects that I instantiate? 1 Answer
Keyframes of animated Child gameobject not shown by parent gameobjects animator issue ? 0 Answers
Why are these object passing through each other? 1 Answer
Calculating Scrolling GameObject x position scrolling pass another GameObject x postion (2D Game) 1 Answer