Jump to content
  • Advertisement
moeen k

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

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!