Hello. I’m trying to make a 2D game in which there is a weapon which i can pick up and shoot. However, the weapon script makes it so that when i click mouse0 for “fire1”, it shoots a raycast even if i have not picked it up and it is still on the ground.
- I was thinking of duplicating the gun and making one of them a child object of my player, and once my player runs into the gun, i could disable the gun on the floor and enable to the gun in my hand.
- Another option i was thinking about was to disable the shooting script unless i had picked the gun up.
I am fairly new to unity and have been following tutorials on how to do things, never really straying far away from the instructor’s code. However, i am at the point where i want to make my game more unique but i cant find any tutorials for the goals i am trying to achieve.
I need some help to solve this issue, any way to solve it or some help with the options above.