Rock pushing puzzle eventing trouble

I've got it to where you can push the rock, it'll make a sound when you push it, and when you push it on top of a switch it'll hold the switch down. Pretty standard stuff.

The part I'm struggling with is making it so that the rock doesn't do anything if you try to push it in a direction that it's not allowed to go. As far as I know, RPG Maker doesn't naturally have something like ray casting and I don't really want to do the nuclear option of setting a region ID for every single possible combination of directions it isn't allowed to travel.

Right now, if you push a boulder into a direction it can't go, like up against a wall for instance, it will make the animation and sound of moving but won't actually move into the wall. Setting it to "ignore if can't move" doesn't seem to skip the animation or the sound, it just makes it so that the boulder itself doesn't move.

So, before I take that nuclear option, I just wanted to know if there is something obvious I'm missing or if there is a better way to do it. Here's what the event page looks like now. I have the Stop SE command at the top to make it so that the sound can't stack and will just get replaced, so it's less egregious, but still annoying.

1732372049884.png
Instead of "Move away from Player", you want to do 4 Conditional Branches; one for each direction.

Code:
If Player is facing up
  Move Event: Top, ignore if cannot move
End
If Player is facing left
  Move Event: Left, ignore if cannot move
End
...

Source:
Instead of "Move away from Player", you want to do 4 Conditional Branches; one for each direction.

Code:
If Player is facing up
  Move Event: Top, ignore if cannot move
End
If Player is facing left
  Move Event: Left, ignore if cannot move
End
...

Source:

That does the same exact thing, unfortunately. You can even see in the video at 3:16 he pushes the boulder up towards the water and it replays the animation without moving. If it had a sound, it would replay the sound as well.

EDIT: However, looking through the comments of the video, I found someone suggesting to use this script in a conditional branch: $gameMap.isPassable(x, y)

So what I did was get the x/y coordinate of the boulder, set them to separate variables, and then add/sub 1 from either the y or x variable depending on which way it was going. Then I made the variables in the script use the variables instead of absolute values.

I also solved the issue of it still moving if you interact with it by setting it to Direction Fix and then unlocking the move animation only while it is moving.

Here's what it looks like now:
1732374007290.png


In the end, even though your suggestion wasn't technically correct, linking the video still helped me find the comment I needed so thank you!
This thread is closed due to being reported as solved. If you need it reopened, report it to let us know. Thank you!

Original thread: https://forums.rpgmakerweb.com/threads/rock-pushing-puzzle-eventing-trouble.173413/