gun script not working
im trying to pick up my gun and have a sound play {
public GameObject realHandgun;
public GameObject fakeHandgun;
public AudioSource handgunPickupSound;
private void OnTriggerEnter(Collider other)
{
realHandgun.SetActive(true);
fakeHandgun.SetActive(false);
handgunPickupSound.Play();
}
} thats my code so far i have the object on the ground(the one i want to pick up) and then i have an object as a child thats the gun for when im holding it but when my script is on it it gets out of place and my camera gets messed up but when i untick the one on my first person character its a still image and i can hear myself walking around i need help,im making a fps and i have an object for my gun that i want to pick up and have a sound effect for and i made a object to have where i want it picked up and then i have the object as a child to my first person character
Your answer
Follow this Question
Related Questions
How to make a coin spin(not a 3d mesh) 1 Answer
Imported objects don't react to script (default cube does) 1 Answer
First person controller fly when hits some invisible planes? 0 Answers
is a head bob animation possible for first person controller with capsule collider 0 Answers
Inaccurate shooting script for gun 1 Answer