# Motorcycle Moves Slowly with Wheel Colliders

I am making an fps parkour game and I decided to add a motorcycle. I have created a mounting system and put wheel colliders with a script that added torque to them. I have only tried to make the forward and backward movement first, and I am able to move forward but very slowly no matter how I change the MotorForce or the mass of the rigid body on my motorbike. For some reason, the motorcycle would move fast in a direction if I looked down from the mounted position.

Here is the mounting and driving script:

public class InteractionManager : MonoBehaviour
{

public GameObject Motorbike;
public GameObject Player;

private Rigidbody rb;

public Transform playerTransform;

public static bool ridingMotorBike = false;

public float MotorForce;

public WheelCollider WheelColF;
public WheelCollider WheelColB;

// Start is called before the first frame update
void Start()
{
rb = Motorbike.GetComponent<Rigidbody>();
}

// Update is called once per frame
void FixedUpdate()
{
float distance = Vector3.Distance(transform.position, Motorbike.transform.position);
Vector3 dir = (Motorbike.transform.position - transform.position).normalized;
float dot = Vector3.Dot(dir, transform.forward);

if (dot > .6 && distance <= 3 && !ridingMotorBike && Input.GetKeyDown("e"))
{
ridingMotorBike = true;
}

else if (ridingMotorBike)
{
Player.transform.SetParent(Motorbike.transform);
Player.transform.localPosition = new Vector3(0, 0, 0);

if (Input.GetKeyDown("e"))
{
ridingMotorBike = false;
Player.transform.localPosition = new Vector3(0, 0, 1);
playerTransform.parent = null;

}

rb.velocity = Vector3.zero;
rb.angularVelocity = Vector3.zero;

float v = Input.GetAxis("Vertical") * 600;

WheelColF.motorTorque = v;
WheelColB.motorTorque = v;
}

}

}

Any help would be appreciated!

It might be that not all of the torque is transferring to the ground. Try applying some consistent downward force to the rigidbody.

If you are experiencing issues with your motorcycle moving slowly in your game and you are using wheel colliders, there could be a few potential causes:

Friction settings: Check the friction settings on the wheel colliders and make sure they are set correctly. You may need to increase the “Forward Friction” or “Sideways Friction” values.

Suspension settings: Check the suspension settings on the wheel colliders. Make sure the “Spring” and “Damper” values are set correctly. You may need to increase the spring value to provide more force to the wheels.

Mass of the motorcycle: Make sure the mass of the motorcycle is set correctly. If the mass is too low, it will affect the speed and acceleration of the motorcycle.

Torque: Check the torque settings on the motorcycle’s engine. Make sure it is set high enough to provide the necessary power to the wheels.

Drag: Make sure the drag on the motorcycle’s rigid body is not set too high. This can slow down the motorcycle’s movement.

Check the max and min values of the suspension and also the tire radius.

It is recommended to check and adjust these settings one by one and test the motorcycle’s movement after each change. If the issue persists, you may need to further investigate the problem by looking into other potential causes or by consulting the documentation for the game engine or physics engine you are using Onroadz.in