playMaker

Author Topic: Getting Root Motion to only effect Position & not Rotation  (Read 2026 times)

pez

  • Playmaker Newbie
  • *
  • Posts: 12
Getting Root Motion to only effect Position & not Rotation
« on: August 08, 2018, 01:14:35 AM »
Hi,

I've got an issue with my character controller that I've made custom using playmaker. It all works perfectly.. until I add a rigid body :(

The setup I have is using animation with root motion to control forward momentum - & then using the axis vector angle to update his rotation (relative to the camera). So in a nutshell, he runs towards the direction I point the analog stick.

When I add a rigid body to the stack though, it seems to override all outside rotation influence with the animator's root motion rotation (which is nothing).

Does anyone know how to get around this using playmaker actions? I see that some actions override the animator root motion such as Set Animator Target - but none that I can tell which apply root motion as well, they all seem to just disable it.

Thanks for any help!
Pez

blackant

  • Hero Member
  • *****
  • Posts: 521
  • http://blackantmaster.com
    • blackantmaster.com
Re: Getting Root Motion to only effect Position & not Rotation
« Reply #1 on: August 08, 2018, 02:58:23 AM »
did you tryed to constraint rotation axis on your rigidbody ?

pez

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Getting Root Motion to only effect Position & not Rotation
« Reply #2 on: August 08, 2018, 01:38:53 PM »
did you tryed to constraint rotation axis on your rigidbody ?

Yes my rigid body is set to kinematic.

Still haven't fixed it, but have found one reason as to why it no longer rotates. I was using the iTween Rotate Update, so it didn't snap to rotation but updated over a set time. It seems that iTween doesn't work with Rigid Bodies, so need to figure out another way to update the rotation over X time every frame.

Does anyone know if DOTween can update rotation on Rigid Bodies?

pez

  • Playmaker Newbie
  • *
  • Posts: 12
Re: Getting Root Motion to only effect Position & not Rotation
« Reply #3 on: August 08, 2018, 10:07:30 PM »
Found a resolution for my problem, so posting in-case this comes up in anyone else's desperate search who has the same issue.

Basically instead of using iTween Rotate Update, use Quaternion Angle Axis to store your axis vector & then update the rotation using Quaternion Rotate Towards. This has a 'max degrees delta' which essentially acts as a time to match rotation like the iTween function does.

Cheers