You are browsing as a guest. Sign up (or log in) to start making projects!

56m 34s logged

A Physics Based Car Controller in Unity! (Suspension Physics added)

Devlog #1: Adding Suspension Physics Using Hooke’s Law.

In Cars each tyre has a set off supensions that absorbs shocks and damps it down so that its comfy inside, So it basically is a spring.

So to simulate that in Unity I used Hooke’s Law

that states : Force Exerted By spriing = Spring Constant(material property of spring) X Spring Compression Amount

When we do excert such a force for each tyre of the car, it creates a dynamic spring that changes exerted force by the amount its being compressed VERY COOL.

###But if we leave it like that Its going to oscillate Up and down forever which would not be very realistic. 🥀

So to encounter That I incorporated a damping system which takes In the speed of a given tyre, takes its Dot product with the vector UP , which tells us how fast is the tyre moving up, and **Lower the amount of exerted force as it reaches closer and closer to 0 compression slowwly losing energy and stablizing **

All that was done by subtracting (tyres downward velocity X damping constant) from the Force equation!!

##Andd that wraps it up for today! See ya’ll tmrw!

0
3

Comments 0

No comments yet. Be the first!