Change Weapons/Animations
stanimation
Member Posts: 406
Hey All, I'm trying to figure out how to have a icon/button that, when tapped, changes weapons on the player, and button, and subsequently changes the animations of the player. Any thoughts would be appreciated.
Thanks!
Thanks!
Comments
a simple example:
create an attribute called Weapons
create a button that when touched, changes the value of weapons:
- when actor receives touch change attribute game.Weapons = (game.Weapons+1)%2
where 2 is how many weapon choices you want.
on the button you can have rules like this:
when attribute game.Weapons = 0
change image misslebutton.png
when attribute game.Weapons = 1
change image lazerButton.png
on your player you'd need two sets of rules, animation and weapon. for animation it's easy:
when attribute game.Weapons = 0
animate (put specific images here)
when attribute game.Weapons = 1
animate (put different specific images here)
for weapons it's slightly different, but still pretty straight forward. You'll have a few rules based on each weapon type. so, if you had a laser and a missle, and using the keyboard Spacebar as the trigger:
when attribute game.Weapons = 0 AND button space is down
spawn actor lazer
when attribute game.Weapons = 1 AND button space is down
spawn actor missle
something like that anyways. if you want to give a little more details, like the kinds of weapons and how you plan on activating the shooting we could get more specific.
Send and Receive Data using your own Server Tutorial! | Vote for A Long Way Home on Steam Greenlight! | Ten Years Left