Hi,
ok, so I modified it, and yes, the jump will need to be done differently with likely proper raycasting ot something as is, the mods to follow ground corrupts the jumping and grounding behavior.
I modified the "Movement" Fsm:
- I get the normal of a raycast hit going down in the world ( this will need to be checking for wether it hits a ground object or not, use layers or more complex fsm to do this)
- then I use the horyzontal axis within a crossProduct to get the up AND forward direction in one go (quite happy with this trick actually, else it's a nightmare to combine rotation of character and ground normal
)
and that's it really. I keep the velocity as is without reflecting the angle of the character, I don't think you'll have ground at very high angles anyway, else you would then need to express velocity in local coordinate of your character
I have attached a modified scene taken from the tut you mentionned.
Let me know how it goes
Bye,
Jean