1

I am stuck with two things while trying to simulate the physics setup for a trolley-like object (push powered vehicle with free rotating wheels on the front and fixed wheels on the back).

I have the RigidBody with its mesh and four WheelColliders, the object moves fine if I just apply torque to the wheels. However if I use the AddForce method on the RigidBody it won't move; I see the object being pushed (slightly balancing) but the wheels won't rotate so it stays in place. How can I get the wheels to move if the object is being pushed?

My other problem is to simulate the standard 360 degrees rotating wheels on the front of the trolley. What would be the best way to simulate this? I was thinking about a horizontal WheelCollider and a vertical one as a child but that seems really weird and I doubt it will actually work. Any ideas?

momo
  • 3,404
  • 6
  • 37
  • 66
  • Hey, did you found any solution for this problem ? If yes, could you share it ? Thanks ! – Maloz Apr 11 '20 at 13:46

1 Answers1

0

https://docs.unity3d.com/Manual/WheelColliderTutorial.html

This tutorial shows an example of how to use the wheel colliders and apply steering and torque to them.

It might be what you are looking for in regards to the adding force part.

I suspect it might allow the 360 degree rotation as well, but I am not familiar enough with these colliders to guarantee that.

EDIT:

In the guide there is the line:

public float maxSteeringAngle; // maximum steer angle the wheel can have

Which looks relevant for the 360 degree turning.

Doh09
  • 2,324
  • 1
  • 16
  • 31
  • Thanks but I already have what that example shows. The example is for a car-like object where the player controls the torque and steering via input, I want my input to become a force applied to/pushing the vehicle and the wheels rotating depending on where is the force being applied. – momo Dec 11 '17 at 03:26
  • I suppose if you add a "car" like object and then connect it via joints to a trolley like object, that it would behave as you expect. I imagine the car sort of pushing and pulling the trolley. A trolley is basically a car where the pivot point is at the handle bar. Placing the steering point at the back axle might make it more trolley like. EDIT: I tried the guide with back axle steering, motor power set to 50, and max torgue to 45. It's not 360 degree, but it seems more trolley like than the car. – Doh09 Dec 11 '17 at 10:11