Hi there blenderers!

I’m making a sonic game, and I want him to jump away from the surface he is standing on. The problem is I’m taking reference of The Sonic Physics Guide, from Sonic Retro, but this only applies to 2d games.

In 2d games, the formula to do it is something like this:

xspeed = jumpspeed*sin(ground_angle)
yspeed = jumpspeed*cos(ground_angle)

But in 3d… well I’m kinda stuck, I guess I could get the angle of the ground with hitNormal somehow, but have no idea on how the formula could be, because now i have **two **angles and **three** axis.

Please help me.