Damage is done to enemy even when not attacking
Hey all, so im currently taking my first class in level design and i need to create a 2D game and ive decided to go with a platformer. Im very new to unity but ive gotten pretty far. However, im having an issue that my enemies are taking damage even when my player is not attacking. So the mechanism i have in place is my player character uses a flashlight to defend itself and i have it set up that while the player presses the "E" key, energy is used over time and the light from the flashlight turns on. What im trying to accomplish right now is to have it so only if the light touches the enemy is when they take damage but as of right now they take damage just touching the player even when the light isnt on. If anyone has any ideas to how to adjust this, I would greatly appreciate it. I have attached my flashlight script and if any other info is needed to further assist, please let me know.
Your answer
Follow this Question
Related Questions
Damage not working properly 1 Answer
Display Hit Text On Collition 0 Answers
Problem with simple attack Attack ui Button 1 Answer
Help 2D attack 1 Answer