HOW TO GIVE DIFFERENT TYPE OF GUN OR STRIKE POWER DURING GAME #godot2D ? {gdscript}

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By pixistone

i am pretty new with Godot and programming as whole , but i am learning.

my player go to a box, break it, then he find a gun and grabs it… here i am able to do to the box braking thing. but i don’t know how to appear the gun and grab the gun after the breaking the box.
if i am trying to be more clear… I WANT THE GUN CHANGING ACTION LIKE “Mini Militia” GAME…
SOME ONE PLEASE HELP…
I AM STUCK.
and THANKS in advance…

Please don’t all caps, it might attract more attention but also will make people less likely to help.
And in general guidelines, you want your box breaking signal/action to instantiate a gun, probably an Area2D or RigidBody with a sprite attached to it.,that is your gun in the floor. Then, when your player grabs/interacts with the gun in the floor, you either despawn the gun from the floor and instance it into your player in the correct position, or reparent the gun to the player. The way to know where to place the gun is usually by having a Position2D in your player that tells you where the gun object should go.

tastyshrimp | 2019-12-26 14:56