Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to change the look direction of a character at end of path
#1
I tried 

[font="JetBrains Mono", monospace]m_OnEndReached.AddListener(Listener);[/font]

[font="JetBrains Mono", monospace][font="JetBrains Mono", monospace]private void Listener(CurvySplineMoveEventArgs arg0)
{
    //transform.Rotate(transform.rotation.x,180, transform.rotation.z);
    transform.rotation = Quaternion.Euler(transform.rotation.x,180, transform.rotation.z);
}[/font]
[/font]


[font="JetBrains Mono", monospace][font="JetBrains Mono", monospace]in SplineController..[/font][/font]

[font="JetBrains Mono", monospace][font="JetBrains Mono", monospace]I get the callback but the object never rotates?[/font][/font]
Reply
#2
Hi
The controllers control the object's transform, so any modification to the transform will get overriden at the next update call of the controller. To change the orientation, I recommand you to modify the Direction parameter of the controller. If you want to do further modifications on the transform, then you will have to disable your controller while running your own logic, or use a custom controller (that overrides BaseController or any of its children classes) that will incorporate in its logic the logic you want to apply.
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
Shocked Change spline path at runtime burn0815 7 811 05-27-2021, 08:27 PM
Last Post: _Aka_
  Create a path with Curvy from a "position" animation with several keyframes mc_deimon 1 310 05-20-2021, 10:04 AM
Last Post: _Aka_
  Spline Shape not centering around Spline Path tfunitydev 3 530 05-13-2021, 08:50 AM
Last Post: _Aka_
  How to change the mesh inside the generator elitegorgong 5 743 04-03-2021, 04:53 PM
Last Post: _Aka_

Forum Jump: