top of page
Search
  • Zac Emerzian

Hitting a Wall

Ironically, I hit a bit of a wall updating the collision system for the race track.


The previous race track collisions were a temporary measure for early playtesting. They were never going to be permanent. So recently the time came to redo the collisions with a method that would be easier to implement on more complex race tracks.


In Unity terms, the black shapes are a big mesh collider replacing the obscene number of box colliders.

After finishing the collisions on the track, I noticed there were some adverse side effects of this change. Most notably, the player could sometimes drive straight through the walls. To remedy this, I also overhauled another placeholder system: the movement system.


The movement is now physics-based. This allows for just a little bit of slipperiness when driving, to help deliver that high-speed hovercraft feel, and makes collisions easier to manage.


When fixing up the movement, I realized that I didn't have a good answer to the question "What happens when a vehicle hits a wall?"


Obviously it shouldn't go through the wall, but I wasn't sure if the vehicle should just stop, or bounce off (and if so, how?), or lower the speed (and if so, how much?), or something else.


I decided to do some research to figure out what would be best solution for Speed Dating. This research involved driving into walls over and over in a number of racing games to see what happens and how it feels.


The black walls are just for testing, they will normally be invisible.

We went with the bumper car solution. When the players hits a wall, they bounce a good distance away from it in direction of the wall's normal. This collision also drops the player's speed a decent amount. Hitting a wall is more of a slap on the wrist than anything, we wanted to keep the pace up and not punish the player too much since perfect driving isn't the focus of the game.


No big flashy new things this time, but we did establish a more solid foundation, improve the feel of the racing, and paved the way for race tracks that are more interesting than a simple square.

Thanks for reading!

7 views0 comments

Recent Posts

See All
bottom of page