Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wheel Collider to propel along Spline
#1
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.

Thanks!
Reply
#2
Hi,
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 api.curvyeditor.com 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.
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Dummy spline points hnngaf 0 12 11-14-2019, 02:08 PM
Last Post: hnngaf
  Refresh spline doesn't seem to be working dazz777 4 56 11-13-2019, 11:13 PM
Last Post: _Aka_
  Same Spline Extrusion with variable width MarioBag 5 656 11-04-2019, 01:56 PM
Last Post: _Aka_
  Change curvy gizmos to show direction of spline Horibe 1 45 11-01-2019, 07:02 PM
Last Post: _Aka_

Forum Jump: