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 helps immensely. Thank you.
Available for freelance work—feel free to reach out.
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 helps immensely. Thank you.
Available for freelance work—feel free to reach out.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Left-right movement, and spline follow shihaya 3 10 07-12-2024, 12:50 PM
Last Post: _Aka_
  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 8 05-21-2023, 05:03 PM
Last Post: _Aka_
  Generator does not exactly follow the path F.A.L. 3 5 04-24-2023, 03:49 PM
Last Post: _Aka_

Forum Jump: