How do I do this?
rino
Member Posts: 17
How should I approach this?
I would like to make a button on the scene so that when it is clicked, it will spawn a menu that allows the person to choose the different type of weapon he will equip. Here is how I did it so far but need help.
I made a button so it spawns 2 actors (the choice of weapons). In actor 1 (lets say a knife), when it is clicked, attribute of 'weapon' changes to weapon+1.
My main player of the game then has a rule that says when attribute =1 then it will destroy it self and spawn another actor that looks exactly the same exact it has a knife.
My other actor will be weapon -1, so when the attribute of weapon=0, my original actor spawns and the knife actor is destroyed.
My problem is: If I accidently pressed 5 times the knife icon, then my attribute will be +5 and I would need to click 5 more times on the other icon to make it spawn back the original. how to do set a limit or something so I only need to click once to change.
Thank you!
I would like to make a button on the scene so that when it is clicked, it will spawn a menu that allows the person to choose the different type of weapon he will equip. Here is how I did it so far but need help.
I made a button so it spawns 2 actors (the choice of weapons). In actor 1 (lets say a knife), when it is clicked, attribute of 'weapon' changes to weapon+1.
My main player of the game then has a rule that says when attribute =1 then it will destroy it self and spawn another actor that looks exactly the same exact it has a knife.
My other actor will be weapon -1, so when the attribute of weapon=0, my original actor spawns and the knife actor is destroyed.
My problem is: If I accidently pressed 5 times the knife icon, then my attribute will be +5 and I would need to click 5 more times on the other icon to make it spawn back the original. how to do set a limit or something so I only need to click once to change.
Thank you!
Comments
Another way is to spawn another actor that covers the first and makes it look checked. Clicking again on the checked actor makes weapon<1 and destroys the checked actor to leave the original.
Hope this helps
Cheers