Push up correction for pickups - [Game Maker Studio 2 | Basics]
This basics video tutorial shows you how to create a solution for pickups that land on a wall instance. Because there are different random speed values you normally get a clustering of y values where a collision is taking place. This can have issues that the pickup is too stuck in unreachable places and well, it looks cleaner if the pickups are once on the ground are lined up neately with the same height.
The idea is quite simple. You have a collision which is canceling the speed and gravity values (which were set upon spawning) and we do an additional collision check to line up all pickups vertically with one y position above the instance walls bounding box.
Note: This first approach only works on horizontal wall collisions. To have this also work with vertical walls, you need to setup a step event with 3 collisions which are shown in the video.
▶ Gamemaker Studio: https://www.yoyogames.com/get
▶ Trial limitations: https://help.yoyogames.com/hc/en-us/articles/230407528-GameMaker-Studio-2-Trial-Limitations
🎮 My free game Clunky souls:
https://1up-indie2.itch.io/clunky-souls
💓 My assets:
Get some assets at itch.io https://1up-indie2.itch.io/
👑 Support me and get fresh game art and game maker projects every month:
https://www.patreon.com/1upindie
Follow me on:
📸 Instangram: https://www.instagram.com/1upindie
🐦 Twitter: https://twitter.com/1upIndie
💬 Discord: https://discord.gg/gvr98nb
📜 Udemy: https://www.udemy.com/course/become-a-video-game-developer-with-gms-23/ (See youtube about page for discount)