Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controlling Velocity of Spline Controller
#1
Hello,

I am using curvy move a character (RED Box) on a spline, while the player chases it. I need to have the character stay at a fixed distance ahead of the player. The player is a rigidbody, but I am using the spline controller for the chased character. I can control the speed of the chased character but I need to figure out a way to control the velocity/speed so I can offset it to stay ahead of the Player. I am trying to figure out how the spline controller moves the character but I am having a hard time.

[Image: Chase_Test_002.gif]
Reply
#2
Quite simple, two ideas come to mind, both assuming you know spline distance between the two objects (GetNearestPointTF or reading controller position):

1.) Check Distance between the two and slightly raise/lower controller's speed to reach close to the wanted distance. Could be too inaccurate for some scenarios.

2.) Like above, check distances, then set the 2nd object's position to match the wanted distance. Let controller's speed fixed at 0.

Both ideas can easily be done with a custom controller and one overriden method (e.g. UserAfterUpdate or any method called each frame).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Best way to duplicate a spline with an offset Kapistijn 7 216 02-07-2026, 07:59 PM
Last Post: _Aka_
Smile Constant speed along a spline? tfishell 1 404 11-13-2025, 11:32 AM
Last Post: _Aka_
  SplineController Ignores Follow-Up and Chooses Wrong Spline Josenildo 7 3,856 07-29-2025, 09:15 PM
Last Post: _Aka_
  Curvy Line Renderer for UI Spline? gekido 7 5,372 07-13-2025, 07:11 PM
Last Post: _Aka_

Forum Jump: