[GameMaker Studio 2] - How To Get Un-Stuck In A Wall -- Tutorial

preview_player
Показать описание
Even with the best collision prevention, it sometimes still happens that you find yourself in a wall and can't get out. I'll show you what to do when that happens with a simple, brute force for loop, that will keep your characters where they're supposed to be.

Social:

My Exclusive Courses💻🎮:

Music courtesy of OC Remix.
Рекомендации по теме
Комментарии
Автор

the information about middle left to middle center just fixed all of my collision problems entirely... your a god dam legend

eukelarTV
Автор

I know this video is old, but I wanted to add to the outpouring of gratitude you've already gotten for this simple, easy to implement solution. Fixed all my sprite sticking issues immediately. Thank you!

shadowSquall
Автор

after spending the last couple hours going through dozens of tags finding no info on how to fix the problem i was having, this finally did what i needed it to. thank you!

spectralsaint
Автор

So simple! I have pass many hours yesterday trying to imagine different solution, and didn't even think about something as simple as what you've done. It worked perfectly! Thanks :)

cardsofsurvivaltheisland
Автор

at first I thought this didn't work, until I realized I put a 1 instead of an i, then it did work. This really helped me

Superplush
Автор

I was having soooo many issues trying to figure out a way to do this. Basically, in my project, you have a bow and when you shoot it you get knock backed in the opposite direction of where you're aiming, and I kept getting stuck in walls on the x value if I was too close to one. This worked PERFECTLY, thank you so much.

Mortifiedxpenguin
Автор

mann, u rlly shall be proud, ive been working my butt of to try to find an video to help me to fix it and i found no one, but then you helped thx man rlly thanks :)

THETOES
Автор

I didn't want to write that many if-statements through a brute force solution. But I have to admit, that works. Thanks!

Kawaiivee
Автор

Dude you just saved me from about 2 days of frustration. Subscribed right when I got my results. Thank you so much!

deadchannel-du
Автор

thank you so much for sharing this! development on my project was halted because my player object kept getting stuck in collision objects and I couldn't find a way to fix it myself that looked decent. This just works! I might try to use a switch statement later on because the amount of ifs here scares me, but it'll do great for now! Thanks again!
The strangest thing was my sprite is just a square right now while I wait for proper sprites from my artist. Anyway, you're a blessing

faxinspace
Автор

I want to thank you for this tutorial! I'm currently working on a project now where the player can change sizes. I had an issue where if you changed while next to a wall, you could get stuck! Now that is no longer the case and It's all thanks to this tutorial! Thank you!

McFlyGold
Автор

This works so well! My object always get's stuck because it rotates, but thanks to your system now it works so well!
Thank you!

frikativos
Автор

Wow, I must say - this is a great work around. Well done. Yes, its a lot of if's - but when games have more complex sprites - this is fantastic.

Kudos to you sir.

meganoob
Автор

Thanks man. This implementation is way, wayyyy better than the tile-based collision detection systems I have found.

CassidyListon
Автор

Oh my god THANK YOU. I have been "stuck" (hahahaHAHA) on this for DAYS.

aldorn
Автор

Thank you!!! I spent days trying to figure out how to just get my character unstuck from the occasional single pixel overlap.

DanielBlakeAF
Автор

great solution for a common problem I had with many of my projects! Thanks and good job!

ikonhero
Автор

Great tip. Glad we can get the code from google drive, more tutorials should have this.

selenearts
Автор

Works beautifully for me, thanks a lot.

ClaydsonVieira
Автор

i love these really simple, short but super helpful tutorials. Your the man dude, keep it up!

MinecraftEnthusiast
join shbcf.ru