Animation won't play when hitting E.

I wasn’t entirely sure whether to put this within Animations or scripting, but I chose scripting because it is more of a scripting issue. But in a nutshell, I have this script here so that whenever I look at a certain object, (named switch001) and hit E, the door will open. But when I hit play and try to do that, nothing happens. This is my script for the door.

And the switch uses the same one. I have “Action” set to e in the positive button section, but it still is not working. Any help at all would be great!

OpenTheDoor is a coroutine but you’re not calling it like one so none of your yield statements are going to work the way you want them to. Also - what is shortWait? Also - you’re trying to set enabled on the anim after you get it with GetComponent which implies it’s disabled by default. If so - you need to do GetComponent<>(true) in order to search for disabled components.

This of course assumes you’re hitting that method at all. No clue what PlayerRaycast does so I’d start by checking that.

I used that script from someone else after failing to fix my first script, because it was saying there were Unexpected symbols “)” That I couldn’t figure out. And I’m making an FPS, so the PlayerRayCast basically sets up a Raycast so I’m able to hit targets, and gauge the distance between me and them. But this is a look at the original script that I wrote, with the error “Unexpected symbol )” That was listed four times. If you could help me figure out this one, that would be amazing.