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
  Method of scattering objects along spline joebain 1 3 11-26-2024, 03:20 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 5 13 10-29-2024, 10:19 AM
Last Post: _Aka_
  Player move with object mcarman 4 8 07-29-2024, 06:49 PM
Last Post: mcarman
  Nested Spline Volume Spot Instantiation merobbins5 3 7 07-26-2024, 09:58 AM
Last Post: _Aka_

Forum Jump: