change weapons with touch of button help please?

allc1865allc1865 Member, PRO Posts: 777
Hello!
I have a side panel that is located in the game that has a bunch of different weapon upgrades in it. So when the user goes inside the panel and clicks a weapon, the main player actor will change it's weapon to the weapon you have chosen.
So I'm wondering how to change the weapon on my main player actor to the weapon you have chosen.
I hope that explains it!
Thanks! :)

Best Answers

  • GM_PandagamesGM_Pandagames Posts: 228
    Accepted Answer
    just make the button change the picture of the weapon
  • KevinCrossKevinCross London, UKPosts: 1,894
    Accepted Answer
    Have one game attribute for players weapon, either as a number or string.

    On the weapon buttons set that attribute the weapon when pressed i.e.

    game.weaponEquipped = 2
    Or
    game.weaponEquipped = "Dagger"

    On the player actor or the weapon actor that is constrained to your player actor have a rule that says if game.weaponEquipped = "Dagger" then set self.Image to "Dagger.png".

    If the player and weapon is all one image then same thing but change the image to the image where the player is holding the dagger i.e. "CharacterHoldingDagger.png"

Answers

Sign In or Register to comment.