- Home /
How to check if specific objects touch
So first let me point out I am a complete N00B so if I sound a bit dumb, I have an excuse.| So I am making an FPS and don't want to make it so that the character can go deep into water. So what I have if make a cube, put it above the character and made it a parent of the character. Then I added this script to the cube.
function OnCollisionEnter(Bam : Collision) { if(Bam.tag == "pond 2") { Application.LoadLevel(0); } }
This is supposed to make it so when the cube touches the water, the player goes back to the main menu screen. When I try it in the game it doesn't work though. The player just keeps walking. If anyone would help me that would be great!
Your answer
Follow this Question
Related Questions
Moving object with touch input and detecting collision 1 Answer
Check if two objects have the same position. 2 Answers
Script when i touch an object it must do something 1 Answer
Fade into other object on touch/drag. 1 Answer
Checking position 2 Answers