Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Wheelcollider not affected by Rigibody weight

Discussion in 'Scripting' started by TnR, Sep 14, 2014.

  1. TnR

    TnR

    Joined:
    Sep 12, 2014
    Posts:
    3
    I'm trying to make a car driving simulator and that needs proper simulation of real world physics. My problem is when I move the car in the script using the WheelCollider's motortorque function the Rigidbody's mass is ignored totally! Changing the mass while keeping the same torque makes no difference on the acceleration e.g 1100 kg (car's mass) and 1kg cause the car to accelerate at the same rate. Rigidbody's gravity is checked and kinematic is off. I've searched for an answer and only two people seemed to have the similar problem and no one could explain why is this happening.

    I've lowered the rigidbody's center of mass and everything which does affect the acceleration, but changing the Rigidbody mass for that particular center of mass makes no difference to the acceleration either. Is that how I make the Rigibody's mass to have an effect on WheelColliders torque, keeping fiddling around with the Rigidbody's center of mass until I get the right acceleration work from there and ignore the Rigibody's mass or place the mass on the WheelColliders (not my favorite solution).:confused:
     
    Last edited: Sep 14, 2014
  2. Nition

    Nition

    Joined:
    Jul 4, 2012
    Posts:
    781
    Coudn't you just divide the motorTorque you want to apply by rigidbody.mass before applying it?
     
  3. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    Mass doesnt have much of an effect on wheel colliders. Its used mainly in collisions (is item A heavier than item B). I would use real mass for both car and wheels. 25ish is a realistic mass for wheels.

    getting the accelation/rpm/torque/slip etc correct is where you should focus.