6
\$\begingroup\$

I new to game development with Unity and my first project is a slot car racer. For a realistic slot car-like-driving experience, I first build a track with a channel in the track and a pin on the car. This kind of works, but it does not look like a slot car, its more like a car with a pin and sometimes the physics just go crazy and kick me out of the channel.

I next tried making a spline with a simple game object following the track. I attached my car to my "follower" with a fixed joint. This didn't work so well: My car was tumbling and pulled sideway but I never archived that my car gets pulled down the track.

How should I be approaching this? I'd like the car to accelerate and decelerate quickly, with that acceleration and deceleration controllable by the user.

\$\endgroup\$
  • 1
    \$\begingroup\$ Fun coincidence: There's a slot car AI racing competition called Hello World Open currently going on. The tech spec might give you some ideas, though their implementation of the physics is not public (yet) for competition reasons. \$\endgroup\$ – Anko May 12 '14 at 14:34
2
\$\begingroup\$

You should consider using a large rectangular prism as the pin. Keep in mind that what you draw on the screen does not have to match the meshes that are used to determine the collisions. You could draw a normal slot car on the screen, but use a large rectangular prism mesh that is not visible to the player, which would help prevent the car from being thrown from the track on high-speed turns.

The length of the prism could run parallel to the track, and the length and width could easily be adjusted to get the precise collisions that you are happy with.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.