Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
UI Text move backwards/reverse along Spline
#1
Hi,

Is there a way to make an object follow a spline in reverse? Specifically, UnityEngine.UI.Text, using the UITextSplineController class.

I tried a few things - making Speed and/or Timescale negative, and changing the animation curve, but none of these achieved what I was looking for. I also tried setting mySplineController.Direction to -1 and that kind of thing, but had no success.


Alternatively, is there a quick way to reverse the Spline without manipulating its gameObject's transform (I don't want to do that since there are UI elements as children to that gameObject transform)?

I'd be looking to use the Loop clamp, also.

Thanks
Reply
#2
To reverse a spline, use CurvySpline.Flip() or the corresponding toolbar icon.

If a controller doesn't use animate, negative speed works. However, using negative speed with Animate isn't working. That's a bug and will be fixed. As a workaround, use positive speed and a negative animation curve, e.g. instead a curve from 0 to 1 (y axis) use a curve from 0 to -1. I tried this and it works flawless with the UI Text Spline controller.
Reply
#3
I am able to adjust the speed in the inspector from positive to negative prior to running the scene and the object will move in opposite directions. But changing this variable with the game running does not affect the direction.

Should it? Or is there another way?
Reply
#4
(12-14-2016, 09:20 PM)Bradical Wrote: I am able to adjust the speed in the inspector from positive to negative prior to running the scene and the object will move in opposite directions. But changing this variable with the game running does not affect the direction.

Should it? Or is there another way?

Got the same problem here, so could you help with the playmaker solution as well.
Reply
#5
When flipping signs, be sure to "reset" the speed by setting it to 0 in between, like

Code:
// Speed is positive, e.g. 10
myController.Speed=0;
myController.Speed=-5;
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Curvy Line Renderer for UI Spline? gekido 3 6 04-04-2024, 12:56 PM
Last Post: _Aka_
  Get position of all control points for a spline gekido 1 6 03-28-2024, 10:08 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
  GO can't fit end of the spline GameDeveloperek4123 3 14 03-04-2024, 11:06 AM
Last Post: _Aka_

Forum Jump: