Question by
harryjbrioche · Nov 19, 2019 at 10:49 PM ·
gameobjectscombatclicking
how to get a variable from an instance of a game object on click.
Basically I'm making a game similar to fire emblem. during combat, I want to be able to click an enemy game object and get the instance of the variables in the game object (eg. HP and ATK) and then use them to run damage calculations. I also need to change the value after the calculations (so the HP will drop). I'm pretty new to unity so any help would be greatly appreciated
Comment
Your answer
Follow this Question
Related Questions
Best practice distinguishing simple click from drag 2 Answers
[solved] Survival Shooter - 'Player' tag mysteriously filled 2 Answers
how to call a function with a gameobject as a argument 1 Answer
Bitmap applied as material to a cylinder 1 Answer
How to orbit one GameObject around another in the direction opposite of the mouse in 2D? 1 Answer