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 

m_OnEndReached.AddListener(Listener);

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);
}


in SplineController..

I get the callback but the object never rotates?
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
  Avoiding runtime GC allocations on control point position change Ell223 8 18 02-24-2024, 10:43 AM
Last Post: _Aka_
Wink Train carriage with 2 bogies following a path arcadeperfect 9 27 08-25-2023, 02:56 PM
Last Post: arcadeperfect
  Generator does not exactly follow the path F.A.L. 3 4 04-24-2023, 03:49 PM
Last Post: _Aka_
  How to get direction of last control point? _RicO 4 23 04-13-2023, 11:27 AM
Last Post: _Aka_

Forum Jump: