Hiding Mechanic

So I was trying to build a hiding mechanic into one of my projects that if you would overlap or press a button to enter in a hiding place (like a bush, closet, …) that the enemy would stop following you and start moving in random directions until you leave the place.

Could anyone help?

4 Likes

Sorry for replying super late, I haven’t seen this post before. I’ve put together a simple example here. You can hide by holding the A button, and stop hiding by releasing it. I’ve made the monster stop chasing you when you hide, but it’s up to you to make it roam around, since I didn’t have much time to implement that. Hope this helps!

1 Like

Use @UnsignedArduino’s wandering code:

1 Like

Didn’t know that existed, but thanks! Besides, this code isn’t for me, but for OP (who seems to have ceased activity)

Thank you both for having the time to help me

1 Like

No problem, that’s why we’re here!