#Top down 2D gravity/yeeting
14 messages · Page 1 of 1 (latest)
Since its top down, you'd best pick a end position and then move it from start to end with an easeinout function so it moves slowly at the start and at the end. Then while it moves you increase the size of the object and decrease it again, to simulate it getting closer to the camera.
Essentially
move from pos 1 to pos 2 in set time, do so by using easeinout function.
at same time scale from start size to max size to end size in same set time.
ohhmmmm
Well you could start easier and make use of some built in stuff
Logic would be like this:
Create a coin Thats a rigidbody object with collision shape as a scene
Spawning:
- create instance variable
- instantiate the coin packedscene and write it into the instance variable
- apply velocity in a random direction to the instance (the coin).
If this all sounds like voodoo to you, I would highly recommend watching this video: https://www.youtube.com/watch?v=nAh_Kx5Zh5Q
Its long but it'll give you everything yuou will need to implement a coin like this (and other things as well)
This video is sponsored by NordPass Business: An amazing password manager that allows you to securely store and access unlimited passwords, including wifi credentials and credit card information. You can use it for yourself or for entire teams or share your own passwords easily.
You can get a 3 month trial at:
https://nordpass.com/clearcode/
...
I can't write you code to copy-paste
@hybrid drum
nah, i’m pretty intermediate with godot, i dont think i’ll need the intro video. its just this, i wanna know the best way to do it
thanks!
There might be better ways but since its top down, you'll have to fake gravity on the Z axis because it doesnt exist
yeah
i might remove the gravity and just apply a random velocity anyway - it might be nice
The easiest is probably to not worry about gravity at all and just get the direction of the box and then write a tween to move the item from the center of the box in the direction by a certain amount.