Search Unity

Opening and Closing Doors: 2D Top-Down

Discussion in 'Scripting' started by unity_1C3DkHRK6YM3mg, Aug 16, 2019.

  1. unity_1C3DkHRK6YM3mg

    unity_1C3DkHRK6YM3mg

    Joined:
    Aug 3, 2019
    Posts:
    1
    Hi Everyone,

    I am having a massive brain fart figuring out how to open and close a door for a 2D Top Down shooter, when Input.GetButtonDown("interact").

    The idea is that on "interact" door will spring open (I don't need it animated, it's a snap rotation) and push the Enemy back on the opposite side of the door (but ignore Player when/if they open the door on themselves).

    Thanks in advance.
     
    Last edited: Aug 16, 2019