Sign in to follow this  
TheMac

Up and down cliffs

Recommended Posts

TheMac    100
Is it typical to have the bottom sphere attached to a character and have it move along the terrain? I am trying to add the ability for my character to fall off a cliff, or not allow it to walk up a mountain. I am doing this in Ode, so I am building my NPC code from scratch. Is this the common way, are there more efficient ways of restricting the player from walking straight up a mountain?

Share this post


Link to post
Share on other sites
Zipster    2365
A common method is to check the slope (normal) of the ground. If it's too steep (normal.Z is less than a particular threshold), then the NPC can't walk there and needs to slide down to flatter ground.

Share this post


Link to post
Share on other sites
TheMac    100
Just thinking this through, I am picturing a ray say 1 foot in front of the character going down, and if it hits a threshold then it is too steep? I can see problems in that, what if the terrain is not an even slope.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this