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
  Filling a closed spline dynamically rickgplus 1 118 04-16-2025, 08:56 AM
Last Post: _Aka_
  Disable a spline's gizmo when not selected or disabled. mikechr2000 1 217 02-03-2025, 09:34 AM
Last Post: _Aka_
Information Questions regarding spline colliders and collisions with rigidbodies Spyboticer 7 801 01-20-2025, 12:25 PM
Last Post: _Aka_
  Extrude mesh along spline. New and confused user GhostStalker 3 374 01-02-2025, 09:58 AM
Last Post: _Aka_

Forum Jump: