- Home /
First person controller prefab collision
I am almost finished the basics of my game. I have everything done except the levels, and this: I need to know how to make the game come to a different menu, Which I already made, when you the first person controller prefab falls into the water. It should be fairly simple, but can you also give instructions, cause I have tried a few that didn't work. Thanks!!!!
Answer by pyro · Jul 17, 2010 at 09:31 PM
Create an empty gameObject and then attach a box collider to it (Component->Physics->Box Collider) You should see a green cube in the editor screen.
Change the size of the cube through the inspector panel and position it until it covers the entire area you want to be the "water" that triggers your menu. Also check the box in the inspector that says "Is Trigger"
Then create a script and attach it to your new gameObject (something like below)
function OnTriggerEnter (other : Collider) {
//do some check to make sure it's the player object that triggered this collider and then enable the menu
}
I already figured it out, but still gave you a fav answer for being the first! =P
Your answer
Follow this Question
Related Questions
Trigger respawn after collision? 3 Answers
What is the best way to script third person real-time action melee combat in C#? 0 Answers
My attack script is broken, please help. 1 Answer
Load Level on Collision 1 Answer
How to load a scene on collision 2 Answers