• Advertisement
Sign in to follow this  

Up and down cliffs

This topic is 2925 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
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
Do I just pick one location on the ground like the center of the models bounding box and get the normalized vector?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement