Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
SplineController.AbsolutePosition or SplineController.RelativePosition to WorldPos?
#4
Quote:Your example returns the local position of the of the origin spline position. Not the WorldPosition.
Right, Splines return local positions, always. Just transform them!

Quote:No, the transform of the GameObject itself does not updated after UPDATE(current frame) has finished. The SplineController.Position is internally updated but the real GameObject is not! 
Impossible! If you don't believe me, just add a debug log inside CurvyController.Refresh(), right below the call to ApplyTransformPosition()...

Let me guess what happens here in order when you hit play in your project:

1.) Your script sets the position => transform is set to new position (like your Debuglog shows)
2.) The controller starts playing. First, it's set to it's InitialPosition (still 0, I guess) => see the problem? If the controller isn't running, use InitialPosition!
3.) Next frame: Your script runs again, this time setting the position of the moving controller, which works like you want.

It's fine to set the controller from outside scripts, but I recommend using a well defined fixed order. Either by using Update()/LateUpdate() or script execution order.

Hope that helps,
Jake
Reply


Messages In This Thread
RE: SplineController.AbsolutePosition or SplineController.RelativePosition to WorldPos? - by Jake - 01-06-2016, 06:36 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Play() does not cause SplineController to produce expected behaviour ConCat 8 1,409 02-08-2026, 11:54 AM
Last Post: _Aka_
  SplineController Ignores Follow-Up and Chooses Wrong Spline Josenildo 7 4,474 07-29-2025, 09:15 PM
Last Post: _Aka_
Wink In SplineController OnPositionReachedList Event is missing shimizu 2 1,818 02-07-2022, 12:47 PM
Last Post: shimizu
  best way to rotate, change offset, and inset position of splinecontroller object smackledorf 1 1,736 01-17-2022, 01:39 PM
Last Post: _Aka_

Forum Jump: