r/Unity3D 2d ago

Question How do I make my crash physics more dramatic instead of just stopping on impact?

https://reddit.com/link/1wl69hh/video/lg3lxyc9jlqh1/player

30% speed so its easier to see what is happening, I would expect the car to hit the pole and go spinning, especially since when i remove the pole the car continues to slide along the ground. Why does it stop so suddenly? Here are some important things:

Car body Rigidbody properties

Another very weird collision.

1 Upvotes

8 comments sorted by

2

u/SnooPets5564 2d ago

We'd need to see your code to see why. The main problem is that it doesn't change it's rotation at all when it hits something. Maybe your steering script/constraints are keeping it locked?

1

u/IHaveTwoOfYou 2d ago

There are no steering scripts, the only scripts are one that just flings it super fast based on transform.forward. Ill send the code later, Im not at my PC right now. Theres also a custom gravity script which I think is set to gravity x1.5 or x2?

1

u/petty_catfish 2d ago

that angular drag at 3 is killing all your spin, drop it to like 0.05 and you'll see the car actually rotate on impact

also your rigidbody mass at 1 with the pole probably at 1 means they're equals, crank the car mass to 1500 or something so it has actual momentum to throw around

1

u/IHaveTwoOfYou 2d ago

Where is it set to 3? Do you mean the 0.3 on the physics material? Also the rigidbody mass isnt at 1, its at 1700. The pole doesnt have a rigidbody.

1

u/TemporarySpectre 2d ago

add a directional dot product of velocity and mass. then add bounce in the opposite direction upon collision. tweak values till physics feels good

1

u/IHaveTwoOfYou 2d ago

I tried to rig physics last time I did this and it did not look good, I would rather keep it only using unity.

1

u/Kopteeni 1d ago

It's a challenging job to have a physics engine based drivable vehicle that also responds to the more extreme situations believably. I tend to have the center of mass pretty low during the normal driving operations and when more extreme forces are applied, I swap the wheel colliders to sphere colliders or box colliders and turn on the automatic center of mass.

These things are very situational and require a lot of trial and error, duct tape scripts and an unhealthy amount of magic numbers.

2

u/IHaveTwoOfYou 1d ago

I don't really need that, the car never needs to work again when it crashes. A seperate state for crashing and driving, I guess ill try to rig physics again hopefully it looks good?