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
  Best practice for mass-object instancing along 100km spline (railways) plus streaming bs@vectorvision.de 6 90 09-13-2019, 12:30 PM
Last Post: _Aka_
  How to spawn GameObjects on corners of the liinear spline? Pixel Flipper 4 50 09-13-2019, 08:04 AM
Last Post: Pixel Flipper
  How to properly set UV for extruded spline texture Pixel Flipper 3 60 09-05-2019, 11:55 AM
Last Post: _Aka_
  Steer Towards Spline whitecastleroad 3 74 09-04-2019, 01:39 PM
Last Post: _Aka_

Forum Jump: