I’m using the new 2D Wheel Joint and getting some strange results.
Example:
http://gfycat.com/InferiorNastyAdouri (boxes on wheels are just for visualization)
The code to drive all wheels:
public class DriveControl : MonoBehaviour
{
public string axis = "Vertical";
public float speed;
public WheelJoint2D[] wheels;
private void Update()
{
float rotation = Input.GetAxis(axis)*speed;
foreach (WheelJoint2D wheel in wheels)
{
JointMotor2D motor = wheel.motor;
motor.motorSpeed = rotation;
wheel.motor = motor;
}
}
}
Wheel Components:
Some of the specific issues I noticed:
- Lots of jitter
- The cart sometimes floats above on its hinge - as if gravity was very low
- Strange acceleration
- Wheels move along seemingly random axis, instead of straight up and down as set in the Wheel Joint suspension settings
Any ideas why this is happening?