x


Move object to specific position with physics

Hi, I would like to make an dynamic jump pad function where i can input a specific position and have the function dynamically calculate the force and velocity i need to add depending on the declared position. I only need to do this on one axis, I want to drive over the jump pad and have the player to jump and land on the dynamically declared position on one axis - does any one know how to calculate this and add the right physics to make a nice smooth jump? any ideas, thoughts or a solution is very welcome.

/joe

more ▼

asked May 06 '11 at 01:50 PM

TenCommander gravatar image

TenCommander
38 4 5 10

(comments are locked)
10|3000 characters needed characters left

2 answers: sort newest

You could read up on basic physics (google it) and see how to do projectile motion calculations. Note that there are many solutions to 'jump from here and land there' depending on the speed and angle of launch you want.

more ▼

answered May 06 '11 at 08:07 PM

DaveA gravatar image

DaveA
26.5k 151 171 256

Pointers to specific articles that describe what you're talking about would be helpful.

May 08 '11 at 03:50 AM umopepisdn

I was gonna say http://lmgtfy.com/?q=projectile+motion+equation but this one looks promising http://electron9.phys.utk.edu/phys135d/modules/m3/Projectile%20motion.htm I think looking for 'range' is what you need.

May 08 '11 at 05:32 AM DaveA
(comments are locked)
10|3000 characters needed characters left

It would depend on the velocity of the incoming object, it's drag, it's mass, it's physics material's bounciness + drag, the pad's physics material's drag and bounciness and of course the applied force and direction.

Unless there is something I'm forgetting I think it would be way easier to just Vector3.Lerp or Vector3.Slerp the transform of your object to a certain point.


Edit: a solution that would give you total control over the position but will still let it look 'real' (rather then my lerp solution, which would make it move in an unrealistic straight line), is using a spring joint. Have a look at DragRigidbody.js to have a working example. If you can't find this go to Assets > Import Package > Scripts > Select None > Select DragRigidbody.js

more ▼

answered May 06 '11 at 02:28 PM

Joshua gravatar image

Joshua
6.4k 19 25 70

i think both answers are good and i will try using a joint today - the optimal solution would be Daves but if im able to use a joint this seems like a lot less work. i will post my solution later - thank you

May 09 '11 at 12:37 PM TenCommander
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x1869
x885
x498
x49

asked: May 06 '11 at 01:50 PM

Seen: 1695 times

Last Updated: May 06 '11 at 01:50 PM