I have been trying to make a weapon system and I cant get it to finish near the end it never takes the model from the other layer and puts it on the empty. basically I use a message from the pistol on the ground that makes the python code spawn a gun in his hands.
maybe if someone has a better way to get this to work. could come up with script or just give me idea ?
What I am trying to do is make a system with a primary and a secondary weapon when my guy goes up to a gun on ground it assigns it to the current one so if u have primary slot in hand u will replace it (well I guess its just two weapon slots). you press e to pick it up and it places a weapon ready version of the gun from a diffrent layer into your hands.
if pistol1.positive:
#the print's there to check the message sensor is being triggered
print 'pistol picked up'
pistol.instantAddOject()
If it doesn’t appear check to the console, if it’s printed the string then the problem probably lies with the model you’re trying to add or the add object actuator or how it’s being parented/attached to the player. If it doesn’t print then the issue is more likely to be related to the message not being sent/received, ie a typo in the subject or sometimes when using purely logic bricks you string a message actuator with a end object actuator triggered the object gets killed before it sends a message. In that case, best to use python to control the order of execution.