- Home /
How to smoothly interact with doors?
I am working on a top down click to move game. I am currently trying to clean up my click to move script and interacting with doors in a logical way.
I would like to have my player character follow specific clicks and also follow the mouse when it is held down. I would like the player to click on a door and have the character move to a spot that is close to the door and open it, if the character is already in range of the door, open the door.
Currently, my character will follow the mouse and it will open doors, however, when the door is opened, the spot is no longer occupied by the door and my Input.GetMouseButton(0) && !doorSelected both return true and the character immediately moves into the space occupied by the door.
Can anyone outline a way to handle this problem? I can include code if needed.