- Home /
Help - How to make my character jump over hole?
I was new to Unity, My idea was my character keep running and need to jump over hole to survive, or else he will fall and dead. But since holes can't be made on the terrain How can I make a hole that my character can jump over or fall to die Am i need to make object(box) act as terrain for my character to walk and run? and the distance between each box can act as a hole ? Thanks.
Answer by Lairinus · Mar 24, 2014 at 03:31 AM
void OnTriggerEnter(Collider other)
{
if (other.gameObject.tag == "Player")
Destroy(other); // "other.SendMessage("KillOnFallingIntoHole");"
}
You can use a trigger. Make a "hole" in the terrain, and place a trigger that the player will hit if he falls in.
Obviously you don't want to Destroy() the player, but you can use SendMessage to kill him.
Your answer
![](https://koobas.hobune.stream/wayback/20220613141019im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
UnityEngine.Input.GetMouseButton(1)) issue 1 Answer
I made a better shader how do i fix[add _Shadow Strength]help???>Sorry that im asking for to much 1 Answer
Help In Making a SphereCast for 3D Tire! Working RayCast Script included! 0 Answers
Creating a timer for combat (C#) 1 Answer