Jumping over objects while in motion

  • Context: Undergrad 
  • Thread starter Thread starter kool_j
  • Start date Start date
  • Tags Tags
    Motion
Click For Summary
SUMMARY

The discussion focuses on implementing a jumping mechanic in a PC game where an object (objectA) must jump over a stationary object (objectB). The motion is modeled as a parabolic trajectory, with the x-component of velocity remaining constant while the y-component is influenced by initial velocity (y0) and gravitational acceleration (g). The formula used for the y-position over time is y(t) = y0t - (1/2)gt². Adjusting y0 and g allows for customization of jump height and gravity strength, essential for achieving realistic jumping dynamics in platformer games.

PREREQUISITES
  • Understanding of rigid body physics in game development
  • Familiarity with parabolic motion equations
  • Basic knowledge of game physics engines
  • Experience with programming in a game development environment
NEXT STEPS
  • Research "Unity Rigidbody physics" for implementing jumping mechanics
  • Learn about "Unreal Engine Blueprint for character movement" to enhance jump dynamics
  • Explore "Game physics simulation techniques" for realistic motion modeling
  • Investigate "2D platformer jump mechanics" for specific design patterns
USEFUL FOR

Game developers, particularly those working on platformer mechanics, physics programmers, and anyone interested in enhancing character movement in video games.

kool_j
Messages
1
Reaction score
0
Hi,
I'm in the process of designing a PC game and I need to make objectA ,which is driving along to jump over object B which is stationary in its path. Can anyone tell if there is a formula to work out this type of motion.
Thanks :cry:
 
Physics news on Phys.org
A simplistic way to do it would be to assume the jumper is like rigid body and follows a parabolic path while in the air. Let's call the direction in which the jumper is running the x-direction and up will be the y-direction.
Then when jumping, the x-component of the velocity will not change.
For the y-direction, you'll have to know how high he/she will jump, which is determined by it's initial velocity in the y-direction. Let's call it y0.
Then [itex]y(t)=y_0t-\frac{1}{2}gt^2[/itex].

For your game I think you'll have to tweak [itex]y_0[/itex] and g.
A higher y0 means a more powerful jump.
A higher g means a stronger gravitational field.
 
I assume youre looking at the object that's jumping from side on right?
(Like a Platformer) I also assume that you must be keeping its x, y
velocities independent from each other.

y

|
|
|
|________ x

If that's the case, keep your x-velocity constant as the jump is made.
To start with, set the y-vel to some positive value.
(yVel = startYVal)
(This will set how high you want to jump)
As time passes, change your y-velocity as follows:
yVel = oldYVel - g*t**2,
(where t is time and g is some constant that will set your gravity)
When yVel == - startYVal, then set yVal to 0 and end your loop.
(Otherwise your character will just fall straight through the platform)

This should give you a nice parabollic shape for your jump.

Sorry... I couldn't think of any simpler terms to explain this in.
Enjoy making the game! :biggrin:
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
4K
  • · Replies 24 ·
Replies
24
Views
4K
  • · Replies 66 ·
3
Replies
66
Views
6K
  • · Replies 39 ·
2
Replies
39
Views
6K
  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 9 ·
Replies
9
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K