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
  Move CP00X position in hierarchy UsernameHed 1 12 Yesterday, 02:01 PM
Last Post: _Aka_
  Refresh spline doesn't seem to be working dazz777 2 32 11-08-2019, 09:01 PM
Last Post: dazz777
  Same Spline Extrusion with variable width MarioBag 5 631 11-04-2019, 01:56 PM
Last Post: _Aka_
  Change curvy gizmos to show direction of spline Horibe 1 36 11-01-2019, 07:02 PM
Last Post: _Aka_

Forum Jump: