I'm unsure if I should ask the mathematic part of StackOverflow or the gamedev part. I'm trying to figure out how the gravity changes the position of an element in a 3D world. I've been trying to rescript the gravity in a game so I could attach it to every element I want.
As far as I know; The movement of the player has something to do with the current position ( obviously ), the velocity, the gravity and Delta Time. As far as I'm concerned too, I know that when an element makes some kind of jump, he should go up since the velocity is still positive. Each frame should update the player's position, depending on the current position and velocity, the new position will be created. I've been able to create it in a platformer ( 2D ) but I haven't succeeded to do this in a 3D game. As far as I came, the object just flew into the air at a massive speed and ended up landing in another galaxy..
I'm currently working with Lua, if you were trying to explain something in a language. If you're working with another language and want to give me an example in that.. feel free to do so. I'm known with a lot of languages ( programmer here. ). It's just about the logic behind it, the actual math.
Thanks in advance