Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Additional offset to Follow behaviour
#1
Consider In a car game, where the car drifts at corners.

Is it possible to set in curvy to directly allow these offsets instead of following in the exact path? Can you please suggest how to do with curvy?

Thanks!
Reply
#2
Hi,
This is doable via the offset settings:
https://curvyeditor.com/documentation/controllers/start#offset
Have a nice day.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
Thanks for the answer. Can you please give more details on how to achieve this? At-least a rough idea.
1. The car needs to follow the direction of the spline
2. The car when turns will have additional offset from the drift
3. The car can have varied speeds while following the spline path
Reply
#4
Hi,

First, if not already done, please get an idea of the capabilities and usage of the Spline Controller by reading the documentation page, and watching the videos included in that page.

Then, write a script that does the following:

  1. get the tangent of the spline where your object at, and where it was the previous frame.
  2. Compute the angle between these two vectors.
  3. Compute the turn speed based on that angle.
  4. Add offset to your controller depending on how high is the turn speed.

This answers the complicated part, the drift implementation.
For the rest orientation, just setup your controller properly.
For the variable speed, use the API to change the value of Speed.

Here is the relevant api reference page:
https://api.curvyeditor.com/FluffyUnderware.Curvy.Controllers.SplineController.html

Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Animate UV Offset in Unity Animation Timeline sam_bond 6 8 05-26-2023, 11:12 AM
Last Post: _Aka_
  Programming a first-person player/camera to follow a Curvy Spline kenmarold 1 6 05-21-2023, 05:03 PM
Last Post: _Aka_
  Generator does not exactly follow the path F.A.L. 3 4 04-24-2023, 03:49 PM
Last Post: _Aka_
  Way to make gameobject follow splines 'human-ly'? yun844 3 11 01-17-2023, 10:18 AM
Last Post: _Aka_

Forum Jump: