🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

what is the right ways to implement physics-based roller coaster specially in unity engine

Started by
3 comments, last by lawnjelly 5 years, 5 months ago

hi.

im not much experienced in physics but im looking to make a good system to implement physics based roller  coaster. 

i tested many different methods like using physics engine or implement physics rules manually. i tested car system but it doesnt work for exact path and high slopes. 

 

how can i make  right movement based on gravity and force?

i know it can be simply done by curve and path and everything is controlled by that but maybe not realistic

Advertisement

Depending on your game design I'd tend towards doing the physics manually. It shouldn't be hard to get something moving along a path with some gravity and friction, and you could make it a kinematic body in the unity physics if so desired (to have other physics objects bounce off), or to have some effect of collisions on the manual physics.

Doing it the other way by constraining a rigid body to stay on a path is trying to get a physics engine to do something it was not designed to do (unless there is specific support for this or similar), and imo would be introducing a lot of problems, and not offering a great deal of added value over the manual solution.

However if your game design involved e.g. roller coasters crashing, that is a different ball game.

1 minute ago, lawnjelly said:

Depending on your game design I'd tend towards doing the physics manually. It shouldn't be hard to get something moving along a path with some gravity and friction, and you could make it a kinematic body in the unity physics if so desired (to have other physics objects bounce off), or to have some effect of collisions on the manual physics.

Doing it the other way by constraining a rigid body to stay on a path is trying to get a physics engine to do something it was not designed to do (unless there is specific support for this or similar), and imo would be introducing a lot of problems, and not offering a great deal of added value over the manual solution.

However if your game design involved e.g. roller coasters crashing, that is a different ball game.

thnks. can you give some basic technical info?

2 minutes ago, moeen k said:

thnks. can you give some basic technical info?

I'm not sure exactly what you are after, but for doing it manually, (speaking as a non-physics expert lol :) ) .. each carriage will have what boils down to a 1 dimensional velocity (call it w).

If the carriage is moving between 2 points on a path you can convert w to a 3d traditional linear velocity, apply gravity what ever you want, then back convert to w (ignoring components that are not in that direction, because the carriage can only move on the path).

Try it out, see what happens. Storing velocity as w rather than x, y, z also allows you to do stuff like loop the loop.

This topic is closed to new replies.

Advertisement