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.
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.