Volatile Physics


I'm implementing some safety features around the track like fences and tire barriers. Safety should come first, but as it sits right now it seems to be far away from the truth! I am getting some serious volatile collisions with even the slightest of movement of the car. Check it out for yourself:


It's like the Hollywood feature has been left enabled! It doesn't happen all the time but luckily enough it's not too difficult to reproduce, it just requires some patience:


I am somewhat confident that it isn't a Unity bug. The car is modeled with individual parts and each part has a collider and a FixedJoint. The FixedJoint is configured with a breaking force so when a collision is detected that exceeds a threshold for the strength of the carpart the FixedJoint breaks and a rigidbody is added to the car part so it can behave as expected as it falls off the car.  As the car part is detached it is also moved to a different physics layer so it now can collide with the car itself and car parts that are still attached to the car. I think this is where the problem of the volatile behavior lays.

I added a debug log to the car parts and I noticed that twice it was tail lights that experienced a break force in the millions rather than in the thousands. When I had a closer look the tail lights collider was overlapping the rear bumper and I assume that when the tail lights broke off and it was overlapping the bumper it resulted in a massive collision to break free.

I have temporarily fixed that now and I have to see if the volatility is gone. I will be revisiting the way the car parts are attached soon anyway so I will be able to make sure it stays stable.

As you can see I've also started to add some objects like tires and fences.


I am experimenting with performance as I've implemented each fence segment with it's own box collider and a fixed joint with a break force. This way I can have the fence staying intact for slight collisions, keeping the car from going off course, but break apart for head on collisions. I am not sure if I will be able to keep it that way performance wise but I think and hope that the fence rigidbody, collider and fixedjoint is sleeping most of the time unless within bounds or being interacted with so I'll revisit this topic later. The result is quite nice so I hope I can keep it this way:


Finally, I've also added a new Water Mill to the track. I ended up making another low poly Blender video, this time a time-lapse, to show how the mill was made - maybe you can find some use of seeing how it was modeled and implemented into the game:

Comments

Log in with itch.io to leave a comment.

I love the game! I actually landed here by accident because I am looking into making a simple car in unity work (still a newbie). I was wondering if you are using Unity's wheel colliders in your models or are you using your own solution? Cheers and good luck on development!

Is the game very interesting when we can play some version?

Hi - thanks for showing interest. It's a prototype that I may pick up again at some point so I don't know if it will make release as a complete game or a playable prototype at this point.

When some version is available, I'll want to test it.

Hey, I just found out about your game and it looks gorgeous! I was wondering where could I download the latest version!

Hello, do you plan to do any physical tutorial? I think the physics of the car are impressive. Great job.

Hi, thanks for asking. I hadn't considered that but that but I might do so if I get a chance. The problem with vehicle physics, especially for a top down racer, is that it has to be faked parameters to a large extent to get an arcade-like feel to them so it may be very individual based on the proportions of the car etc.

I think it gives a fantastic arcade / simulation feeling and I would love to know how to do some physics like that. I am very fond of car games and I would like to make a game for people who enjoy the sensation of skidding and counter-steering (driving). If you can help me with some advice, I'd appreciate it, I'm new to Unity development and I'm a little lost. Best regards.

Are you going to take it out to the app store? I would love to try it.