FPS tutorial

Is there a way to reload ammunitions, health and rocket by hitting or picking an object?
I’m looking for a simple script because I’m new to Unity and I’m not a programmer.

Thanks

I am not sure if they added the ability in the tutorial or not and am not real familiar with the script but skimming the tutorials, I found in fps tutorial 2 it talks about the script rocket launcher.js up top in that script you will see a variable named ammo count. This variable looks to decrease as the user fires the rocket launcher it should be as simple as setting this to some number other than 0 to make it work. To do this you could create a function like:

function reloadLauncher () {
     ammoCount = 20;
}

And then either calling that script internally or externally.

HTH,

– Clint

I think it will be too complex for me.

The script looks to be written for internal use of the weapon variables,
otherwise there would (!) be addictional scripts for objects like ammo clips or health pack and the demo’s limitations sited elsewhere.
I don’t know how to manage variables outside the script (I must learn more about scripting var, private var ecc.)

I’ll try to manage a collision with a ‘medical’ (a mono usable phone cab?) object with the FPS from inside the main fps script and update the values.

More difficult is to take time for learning the tutorial pdf support docs.

Thanks