Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Animate movement with curve by distance, not time
#4
Ok, some more details. Unfortunately I don't have Unity at hand now, but we give it a try:

Create a custom controller, override UserAfterInit() and bind a method to the OnControlPointReached event. In this method, you'll get access to the spline segment (e.ControlPoint). The segment's length is simply e.ControlPoint.Length.

Feed the controller's TimeScale property with the duration you want the animation to take and Speed with the distance you want to move in a single animation shot (be sure to use Distance in the controller settings).

That should do the trick.
Reply


Messages In This Thread
RE: Animate movement with curve by distance, not time - by Jake - 02-01-2017, 08:01 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting Distance from a World Point zorksox 3 5 04-16-2024, 07:30 PM
Last Post: _Aka_
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
Question Volume Spots inter group distance Sacryn 1 3 02-27-2024, 04:08 PM
Last Post: _Aka_
  Distance travelled across multiple splines jh092 1 7 02-23-2024, 09:44 AM
Last Post: _Aka_

Forum Jump: