Pick up a gun?

I have made two objects, one without any weapon, and the other one have a silence pistol. I want the first object to change
into the object with the weapon, when collision between two objects is dectected.

I can think of three ways to do this.

1. Add both object to a group called “Player” and at the beginning of the game create the object from it name. In the events when you referring to the player object to shoot, jump, check collision…etc use the name of the group instead of the object, this way whatever object you have created from the group will be effected by the events.
When the player object is in collision with a weapon or switch to a weapon, create the object with the required animation from it name in the position of the other object and delete the other object.

2. Instead of having multiple objects, have a single object and add all animation to this object
0:walk with no weapon
1:walk with shotgun
2:walk with pistol

And simply change the animations as required.

3. Make the actual weapon an independent object and when the player collect the weapon or switch weapon just create the weapon object at a specific point of the player and make it follow that point. Actually in this case the first two points can be applied for the weapon object… Add all weapon object to a group and create weapon objects from their name or add all weapon animations to a single object and change the animation as required…

Thank you, it works perfectly! I have one more question. How do i change the topdownmovement extension controls? I know it’s possible since your able to untick default controls in the property menu. Instead of the arrow keys, i want it to use the wasd keys

In the object properties that is using the top down movement behaviour you need to uncheck the “Default control” option so the object no longer using the default controls. After, you need to use the top down movement actions to simulate left, right, up, down key presses whenever you want. For example if ‘W’ key is pressed then simulate Up key press.

Tyvm, you have been a big help :laughing:

Ehmm, i don’t know how to delete this post. But i hope it helps other people, on 2 days i have already got alot further on the game. From this single post

1 Like