I’m making a point and click puzzle game and right now I’m working on a demo to get the mechanics working. I have 2 animations for a little cabinet, an open animation and a close animation. I’ve used the animator window to setup a system and I have triggers set up to trigger the animations (screenshot below). I’m working on a script to trigger the animations when you click the cabinet. Basically, if the cabinet is open and you click it, play the close animation. if the cabinet is closed and you click it, play the open animation. Click detection aside, how should I go about doing this? I’ve looked at a bunch of different tutorials but nothing seems to be working.
Here’s the animator window. demoAnim is the open animation and demoAnim2 is the close animation. Trigger “open” is between idle and demoAnim. Trigger “close” is between demoAnim and demoAnim2. They both work, I just need to be able to trigger them with a script.