Make items with gravity and forces fall more realistically (No gliding) (SOLVED)


#1

Greetings,

In my game, I have a container that gives away two items. When the container is opened, the two items (Which have the platformer behavior for gravity) are launched out at a force, and are expected to fall to the ground in an arcing motion for a more realistic feel.

However, when the items pop out, they don’t fall as intended. Rather, they sort of “glide” to the ground, which looks pretty weird.

Below is a mock up of what I currently have vs what I’m trying to accomplish.

I am using permanent forces for both objects. The instant force doesn’t do jack for what I’m trying to accomplish.

I won’t need the answer for just this problem. The answer will help with MANY things in my game where I need things to fall in a proper arc.

Any help is appreciated ^^


#2

when the animation of the chest play open and you spawn the items set the gravity of the items to ie 400 place a timer o += item.gravity*Timedelta to each item then slowly in time increase the gravity of the items then when items collide floor stop


#3

Sorry, it didn’t work. My events need Trigger Once in the conditions to make sure duplicates of the item don’t spill out.
Also, I tested this without the Trigger Once, but it didn’t make a difference.

Not that it matters, but this object is a bandage. I wanted to make the object lighter than the others, so I gave it less gravity.


#4

something like that, try to tweak the gravity math:


#5

Thanks, but it’s not working properly. I went to a new project to test this out, but when the object spawns, it kind of moves in some sort of a sine motion before it goes through the desired arc.

What should I do now? I’ve already tried the Physics behavior, but it probably isn’t going to work.


#6

I don’t get that sine… even without the permanent force. Something wrong with your math?
Preview%20of%20Platformer%202020-06-27%2021-38-40


#7

Try something like this. without any platformer objects… Press j to create balls…


#8

Thanks mate, your example works quite well. Simple, compact, and effective. Your solution has it all.
I tried it in my game an it’s quite an improvement ^^


#9

Glad I could help. Good luck with your game…