I did exactly the same thing regarding the spring part, but the car would freak out immediately whenever it tilted even slightly. After struggling for a week, I finally came across this video and realized my mistake. By making the car body a cube and placing the tires far away from it, the inertiaTensor ended up being way too small, which was the cause.
@pompix781020 күн бұрын
Sigma developer
@ethanjamesbarron21 күн бұрын
Hey hey I've been tinkering with this movement system for a while now and it's awesome! Unfortunately I've ran into an issue where going up or down slopes causes the movement to sort of sink or float above the desired height. Is this something you guys encountered? Was a fix ever found?
@nielspalmans623722 күн бұрын
how do you get the wheel to cleanly move over any obstacle? I made an implementation based on your approach but cannot for the life of me figure out how to get the wheels so "roll over" obstacles, mine are just cliping through everything, and because my tires are a lot bigger, the issue is so much worse
@dankonion27 күн бұрын
I hope you guys make more games. This is easily one of my favorite couch co-op games I've played on the Nintendo Switch and I have a huge collection of games.
@ConchStreetStories29 күн бұрын
Make it an open world like game, where you have side mission like been a hitman where you have to snipe your target and not be late to return the car! Or deliver pizza with that car or become a Taxi driver for that short time,, add splitscreen for console and i bet this game will become a hit
@toancanh682Ай бұрын
well explained
@aklvyamods8682Ай бұрын
You should make more tutorial like this
@AdamScottPersonnelАй бұрын
Came for the physics, left buying the game.
@MadoLeossАй бұрын
Great video! But math-wise, if you always run at the same FPS you'll get consistent result. But it seems that it would get inconsistant at different FPS? (For example, 30FPS might accelerate/decelerate faster/slower than 120FPS and ultimately give different positions for the same input). There should be some Mathf.Exp and Mathf.Log to calculate the drag/acceleration independently of the framerate
@aklvyamods8682Ай бұрын
if using unity simply do all this calculation in FixedUpdate , this method is independent of framerate
@gameclips5734Ай бұрын
such an incredibly well presented overview of what goes into making the cars work.
@cheszborgorАй бұрын
why do you sound like waleber?
@bruhimrayaltАй бұрын
How do you unlock Bert on the switch????
@reggieisnotadog48412 ай бұрын
This was SO HELPFUL! The hardest part for me was making sure my graphics stuck to the ground (given that that the capsule bobs about a bit), but now I've gotten there it's the perfect combo of physics and control. Love it, thanks again for making the video.
@cyberpunkspike2 ай бұрын
Your variable names are horrific, and it makes understanding this difficult.
@jackarthur35522 ай бұрын
I love this tutorial and it has me inspired to make my own car. However Im wondering why the mass of the of the wheel is used in the force calculation and the mass of the car body itself is not used? I have a very basic knowledge in physics and have trouble understanding this part.
@isitsou2 ай бұрын
This tutorial is the best I have ever watch!
@tnczm2 ай бұрын
I love this so much
@weebooweeboo3 ай бұрын
with the suspension part of this my car just jitters up and down even with realistic dampening. the total difference in height is around 0.15 units of offset from my rest distance and i dont know why
@thenameofxavier18 күн бұрын
did you ever figure out what the problem was? I'm having a similar issue, just very jittery and unstable
@PrinceJay-tsi3 ай бұрын
How can i write the script 😢
@CodeyAzee3 ай бұрын
Is there any COPYRIGHT issues with this code for COMMERCIAL use?
@TJBEATSAMV3 ай бұрын
Nice video ! Luv the way you applied all those physics principals there 💯
@gamin8ing3 ай бұрын
So high quality content man, keep up the good work
@tibastudio42233 ай бұрын
Hey, first thanks a lot for your amazing tuto it helped me a lot for my golfkart game !!
@kundelstein3 ай бұрын
I love the presentation. I will check the game as I missed it (it flew under my radar).
@janogaminghun52543 ай бұрын
I just started unity and I know basically nothing do far but this is super understandable! I actually enjoy learning game creation, that is a bit crazy to me. Being happy to study
@처링-p7i3 ай бұрын
thank you, this video really great!
@StevenSeguin-c8e4 ай бұрын
Does anyone have a demo unity project using this tutorial?
@CB2564 ай бұрын
smort af
@doneyes4 ай бұрын
Seriously, thank you so much. Deserves so many more views
@JubalWillems4 ай бұрын
I love coding tutorials like this that don’t outright give you the code, they kinda just walk you through how it’s done and you still get the satisfaction of figuring it out yourself. Absolutely amazing
@doneyes4 ай бұрын
Yeah now that you mention it I think thats what I like. I straight up watched it twice despite knowing the info from the first watch
@cyberpunkspikeАй бұрын
I prefer both, provide code and explain the design.
@WindBendsSteel4 ай бұрын
The word "Cartoony" should be added to the video title
@ruandemeneses95134 ай бұрын
how to i actually apply this on m y project ? the code are there and the explanation how its work too, but im using a different engine with different methods and language...
@ToyfulGames3 ай бұрын
the idea is to get a feel for the techniques required, and with that knowledge you should be able to apply it to any engine / programming language. the concepts are universal.
@angulinhiduje609323 күн бұрын
@@ToyfulGames hey, first off, i loved your tutorial. i have a question, my suspension dosent ocilate after bing compressed unless its under load. did i do something wrong or is it expected? the only force that compresses the springs is the cars weight. so if you drive off a ledge for example the tires dont bounce. only as soon as the car is on the ground again the tires bounce up and down.
@diegorg644 ай бұрын
I don't quite understand how the sticky to slope is implemented. My character, when walking upwards on an inclined surface, sticks too much to the surface, and when it descends, it stays too high, causing the character to make small falls. This is my code that implements the ground hover: public void GroundHover(float hoverHeight, float frequency, float dampFactor) { Vector3 origin = transform.TransformPoint(_capsuleCollider.center); bool rayDidHit = Physics.Raycast(origin, Vector3.down, out RaycastHit hit, Data.rayLength); if (rayDidHit) { float mass = _rigidbody.mass; Vector3 vel = _rigidbody.velocity; Vector3 rayDir = transform.TransformDirection(Vector3.down); float springDelta = hit.distance - hoverHeight; float springStrength = frequency * frequency * mass; float dampStrength = 2 * mass * frequency * dampFactor; // spring speed Vector3 otherVel = Vector3.zero; Rigidbody hitBody = hit.rigidbody; if (hitBody) { otherVel = hitBody.velocity; } float rayDirVel = Vector3.Dot(rayDir, vel); float otherDirVel = Vector3.Dot(rayDir, otherVel); float relVel = rayDirVel - otherDirVel; // add force float tension = springDelta * springStrength; float damp = relVel * dampStrength; float springForce = tension - damp; _rigidbody.AddForce(rayDir * springForce, ForceMode.Force); if (hitBody) { hitBody.AddForceAtPosition(rayDir * -springForce, hit.point, ForceMode.Force); } } } My parameter values are: - hoverHeight = 1.2f - frequency = 15f - dampFactor = 0.55f
@tengu56284 ай бұрын
Wtf is PhysicsOneUpdatePerFrame I can't find any documentation on it
@派森-m6m4 ай бұрын
amazing
@Lykarus15 ай бұрын
This video is fantastic man. exactly what I needed
@aritrobhattacharya64805 ай бұрын
I am not some advanced programmer so if there is some github file to look at...I would love to check and understand.
@TheWhitde5 ай бұрын
very nice. From what i saw you have no gears... just a "max speed". My sim was getting too technical for what I want but this looks like the right blend of realism without so much technical detail. Getting a good solid base 1st then extras is the way to go. Had a test facility for testing but seen how inadequate it is. I'm adapting this approach now and got the RGB transform vectors in the debug working nicely now. I also ripped out the gears code... and made it so the torque lookup is with normalized values. Car also now just has a top speed and a maximum torque.
@muhammadfaisal71595 ай бұрын
This rigidbody or character controller?
@ToyfulGames5 ай бұрын
rigidbody
@coldfire66795 ай бұрын
Could you make a more detailed tutorial on how to set it up?
@HungryHungryB5 ай бұрын
I guess you're more interested in making games than making devlogs/tutorials-- based btw --but you've clearly got the chops to do this youtube shit as well. I eagerly await whatever you do next.
@super-cylinder6 ай бұрын
How did you create such nice explanatory Animations for your video?
@ToyfulGames5 ай бұрын
it was all made in Unity :)
@owencoopersfx6 ай бұрын
Very cool 👍
@TranquilMarmot6 ай бұрын
Such an amazing breakdown! I think the VehicleBody3D that's built in to Godot is based off of this exactly 😂 Seeing how simple it is, I might just try and implement it myself.
@spiretechnologies69776 ай бұрын
This is great
@diplodocus36 ай бұрын
Make game devs teach physics in schools and colleges and we'll be making our own flying saucers in a few years
@geckoram62866 ай бұрын
16:19 you can even change the grip depending on the spring tension, to make it more realistic (for example, if you're accelerating on a rwd car, the weight is at the back, making the front tires have less grip) Also, how do you measure the wheels' velocity without having rigidbody on them (and being able to drive around without them)?
@ToyfulGames3 ай бұрын
you can get the "point velocity" from the main car rigid body, at the location of each tire. that takes the overall linear and rotational velocity of the car into account and provides the linear velocity at that point (the tire).
@rafaelbrustolin46876 ай бұрын
This video helped me a lot to understand how to make physics calculations through code!
@AhmedAhmed-gh9oe6 ай бұрын
hey friend i didn't understand it i need some help in the video 11:47 i didn't understand rayDidHit does he put it in each corner of the car or just one at the center ?put it upwards or downward ?
@ToyfulGames5 ай бұрын
there is a ray for each tire (corner).
@tinytires6 ай бұрын
Thank you SO much for this tutorial, it helped a *huge* amount with the car physics in my game. 🙏
@AhmedAhmed-gh9oe6 ай бұрын
hey friend i didn't understand it i need some help in the video 11:47 i didn't understand rayDidHit does he put it in each corner of the car or just one at the center ?put it upwards or downward ?