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
  Spline Shape not centering around Spline Path tfunitydev 3 119 05-13-2021, 08:50 AM
Last Post: _Aka_
  Get position on spline relative to world position Mos Def 5 120 05-10-2021, 07:35 PM
Last Post: _Aka_
  Circle shape spline normals are not straight ? VincentAalbertsberg 8 306 05-07-2021, 07:32 AM
Last Post: VincentAalbertsberg
Question Smoothly animate spline growth. boriskourt 3 172 04-26-2021, 08:29 AM
Last Post: _Aka_

Forum Jump: