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
  Input Spline Path Material Option not suported Andrei 3 203 12-15-2020, 12:20 PM
Last Post: _Aka_
  Generated mesh using bezier spline is not following the path accurately processor 3 541 08-25-2020, 04:39 PM
Last Post: _Aka_
  Make GameObject Face towards Spline Path linkinballzpokemon 5 956 07-14-2020, 08:27 PM
Last Post: _Aka_
  Question regarding Spline Generated Path linkinballzpokemon 9 1,861 07-01-2020, 06:10 PM
Last Post: _Aka_

Forum Jump: