- Home /
changed physic-behavior after collision
Hi! Recently I've noticed a strange phenomen with my physics in unity, but I can't figur out the problem behind it.
Here is what I'm doing: Im building a segway-vehicle out of a simple Box (with a Rigidbody attached to it) and two WheelColliders: segway In this state everything works fine! But after I connected (by a HingeJoint) another simple Box (which acts as an inverted pendulum (also attached whith a Rigidbody)), my segway isn't able to drive straight forward, instead it drives a small right curve. The pendulum is kept in balance by fuzzy-logic: my fuzzy-controller just adds a force to the base of the segway (in the right ammount) to compensate the swaying pendulum. This force is added just in the center of mass of the base and the pendulum is set just in the middle of the base, so the force shouldn't cause a torge.
To debug the problem, I removed the pendulum and noticed that the problem whith the "wrong steering" only occours if the segway collides whith another Rigidbody. In this case it was my first-person-controller and in the other case it was the pendulum itself.
So here's my question: Why do these strange driving-physics occour afte my segway (two WheelColliders + Box whith Rigidbody) collides whith another Rigidbody? (After the Collision the problem is still there)
Thanks in advance!
Could you explain how you are driving the wheels when everything works fine? And by small right turn do you mean tight right turn or slight right turn?
Please fix your tags, currently it is one big tag. Press 'enter' between each word to separate them out.
In my model the wheels are passiv. I just add a Force to the base-box to get an acceleration. The steering of the segway is done by transform.Rotate(). The intensity is slightly, but I think it depends on the collision. I think there is something wrong whith my concept: When I use a kinematic-rigidbody for my base, there are no problems with collision. I Should reformulate my question: How do I setup a vehicle:
base: a box whith a (kinematic?) rigidbody, gravity on wheels: use WheelColliders acceleration: add a force to the base steering: base.transform.Rotate() pendulum: box whith rigidbody, gravity on, hinge-joint to the base
Your answer
![](https://koobas.hobune.stream/wayback/20220612114008im_/https://answers.unity.com/themes/thub/images/avi.jpg)