Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wheel Collider to propel along Spline
Hi guys, I'm new to this tool and am giving it a try for a physics-based game I'm just starting to figure out how to best implement.

My goal is to have a wheeled vehicle follow a spline but for it to be propelled by real physics, such as with a wheel collider as we have currently in Unity. I've tried searching the forum but couldn't find anything specific to using the Wheel Collider instead of RigidBody.AddForce. I'm also looking to have it be connected to other wheeled objects that will be pulled along by that initial player-controlled unit, kind of like a train, the goal here having accurate wheel physics.

Can Curvy be used for this, and if so any advice on how to try approaching it? I can otherwise consider trying it with RigidBody.AddForce, that's just something I have no experience in at all yet but I'm sure can be done.

I am not familiar with wheel collider, but from reading the documentation I see that it has a steerAngle property. This is what I think you should modify. At each frame, compute the angle between the car's front, and the spline's tangent, and apply that angle to the wheel collider.
Useful API methods:
- CurvySpline.GetTangent
- CurvySpline.GetNearestPointTF
See for more information
Let me know if you need something else
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.

Possibly Related Threads...
Thread Author Replies Views Last Post
  Spawn object on Curvy Spline. ktpttd 3 129 11-20-2019, 01:38 PM
Last Post: _Aka_
  Dummy spline points hnngaf 1 80 11-17-2019, 06:01 PM
Last Post: _Aka_
  Refresh spline doesn't seem to be working dazz777 4 176 11-13-2019, 11:13 PM
Last Post: _Aka_
  Same Spline Extrusion with variable width MarioBag 5 870 11-04-2019, 01:56 PM
Last Post: _Aka_

Forum Jump: