Pickups

Hi there everybody,

I’m currently making an FPS, you can find the thread here: http://blenderartists.org/forum/showthread.php?t=205161

I’ve seen many tutorials about pickups - where you go near something and it ends itself - but I want something different.

I want this:

You walk over an object (a gun).
It replaces the one you’re holding with the one you just walked over.

I can’t seem to find any tutorials telling you how to do this so I would be grateful for your help.

Thanks,

Matthew.

OK, this can be tricky, but it’s been done before.
What i will be doing for my FPS is have a “state system”
not in the conventional way!
At the moment my shooting scripts read the ammo, clips, fullammo, range (and soon shoot speed, reload time)
What this means is you can easily implement new guns into the game without changing script code.
The script gets the name of the current gun specified in a property on the player. (gun = player["gun])
if you wanted to add gun switching, make another script controlling an empty which is parented to the player, and all the guns are parented to.
you have this script get all the attached sesors (add an always from each gun connected to the script on the empty)
and for each sensor see if the “name of the owner of the sensor” matches that found in the owner gun property.
if not it sets it invisible, and sets it inactive(the bullet script checks if the gun is active, usefull for later)
and then use the pickup to change the name of the current gun in the owner and end itself.s