- Home /
2D RPG Opening a Door with Sprites
I have a 2D sprite character and I want if the player presses w or up for him to be able to check if there is a door behind him, and if it's openable then it should try to open it. Has anyone run into this problem or know how this can be done?
Since the sprites all exist on the same plane I assume that a raycast won't work. And if I were to use a collider to act as a trigger how would I go about doing it that way? Would I have to add it to a cached transform variable then if w is pressed and door!=null then open door?
Your answer
Follow this Question
Related Questions
How can I make 2d sprites for Unity ? 1 Answer
Move to line 0 Answers
Forcing the camera to portray a specific rect at all times 1 Answer
Help with a 2d camera Controller 1 Answer
scramble words from a sentence using c# 2 Answers