- Home /
Best way to make wheels freely turn / swivel? (Like a shopping cart)
I'm trying to make a trolley-like object where the front two wheels freely spin and turn and the back two wheels only free spin. So far I have all four wheels freely spinning with Wheel Colliders, but I'm having trouble configuring the front two wheels to freely turn as well. When the object is placed on a slanted incline, the front wheels should begin to point downhill and then straighten out (just like a shopping cart). Currently, the hierarchy for this thing is
->Gameobject with Rigidbody
--->Cube body with Box Collider
--->Wheel FL with Wheel Collider
--->Wheel FR with Wheel Collider
--->Wheel BL with Wheel Collider
--->Wheel BR with Wheel Collider
Not really sure the best way to go about this, so any help is appreciated!
Answer by Jesse2431 · Feb 09, 2021 at 04:01 PM
woud you mind showing the code? This might help.
There's actually no code yet (other than to visually rotate those mesh wheels) since I feel like this early step could be done with components like a combination of wheel colliders and hinge joints. I guess I want to to use and understand all the Unity components better instead of just jumping to code which is what I'm tempted to do :)
Answer by K0n4N · Dec 28, 2021 at 01:21 PM
Not exactly what you asked for but I solved a simular problem with replacing the front wheel with a physics material with no friction on it applied to a sphere.
Your answer
Follow this Question
Related Questions
Wheel Rotation Wrong 1 Answer
WheelCollider invisible 0 Answers
Problems with WheelColliders' settings 1 Answer
C# WheelHit.force display wheel suspensions on meshes 0 Answers
Vehicle issues. 0 Answers