Rotate character through code

Rizo

New member
Can anyone tell me how can I rotate my character through code?

I tried characterLocomotion.Transform.Rotate but its not working I think some other method is ovverriding it
I also tried SetRotaion method but its not smooth
If anyone knows inform me ASAP
Thanks
 
Please post all character controller questions in the character controller questions forum.

SetRotation will rotate the character according to the rotation that you specify. If it's not smooth then you will likely need to do some smoothing before applying the rotation.
 
Bonjour :)
I think it's faster to tweak the Y value directly in the inspector.
I'm my test scene, I've re-build from scratch my own chacacter called Katerine and I 've noticed when I aimed, I wasn't aligned with the target:

not aligned.png

If you select your character name just above the first one created with the Opsive manager, you can adjust in real time your start position :

Before:
before.png

After tweaking:

after in inspector.png

aligned.png

Personnally I prefer modify value in the inspector rather than coding them in this kind of case ;)

Hope it helps.
Have a nice Day.
Bro'
 
Yeah thanks I used
m_CharacterLocomotion.DesiredRotation = MathUtility.InverseTransformQuaternion method
 
Top