I want to make the player hide in a closet and when the player is hiding it can’t move, how do i lock him in position until you press the interaction key to unlock the movement again?
You really need to give more information about how your game’s enemy movement system is setup (or how you plan to set it up), for any specific and meaningful advice to come your way. Are you using pathfinding, movement with forces, ray tracing, distance measuring, other extensions/behaviors? What kind of game is it, top down, platform, etc.?
With the very little info given, I would guess a variable of if the player is hiding as a true or false, then base the enemy code off that, if its true do different code then if its false.
2d rpg horror game, basically i want to make the player that can hide in a closet or under a bed (for now i just need this) but I don’t know how to lock the player in that position.
I made that when the player is in collision with that object and you press e the player hide (disappear from screen) but i don’t know how to make it not move, cause when i release “e” the player can move around.
Woah, thx a lot, I’ll try this tomorrow.
So i simply use that variable and i add the top-down movement behavior to the player, and when the player collide and " e " is pressed i change the variable, use those codes and it should work?
Yes just add the condition “when player is in collision with closet” under “e key is released.”
In the same event or in a sub event?
Under the same event so both conditions need to be true for the event to execute.
Got it, thx again a lot
It works, thx again a lot🙌