Author Topic: Align Character Quadruped to ground . . .  (Read 311 times)


  • Playmaker Newbie
  • *
  • Posts: 1
Align Character Quadruped to ground . . .
« on: July 13, 2021, 03:05:13 AM »
I'm sure this question must have been posed many times but I am unable to find a complete solution so here goes again . . . apologies in advance.

I have a cube representing a quadruped on a slope.  I align the cube to the slope using a single Raycast -> Direction "0.-1.0" and store the Hit Normal in a Vector 3.

I obtain a Quaternion via "Get Quaternion From Rotation" -> From Direction "0.1.0" To Direction "Hit Normal" = Quaternion.

Then I use "Set Rotation" of the owner [Cube] with the Quaternion from above . . . It works fine.

To move the cube character I have a "Character Controller" on the Cube, I "Get Axis Vector" store the vector and "Control a Simple Move" with the stored vector . . . also works fine.

Normally I would use "Smooth Look At Direction" to rotate the Character in the direction of travel however, this obviously doesn't work as it conflicts with the "Set Rotation" action.

My two questions are:

1. Is this a satisfactory way to align my character to the ground or is there a better way?

2. If my align to ground is OK how do I simply rotate my character in the direction of travel.

Many thanks in advance all help greatly appreciated, point me at Tuts if you know of any . . . LA