- Home /
The question is answered, right answer was accepted
Add variable to Gameobject without attaching script
I'm relatively new to Unity and i was wondering if there is some way you can add a variable to a gameobject without it needing a script?
For context: i'm creating a small arcade shooter and i'd like to have types of enemies. The enemies have the tag 'Enemy', but then i would need a way to add another variable to say what type of enemy it is. Or should i just create additional tags for the different types?
I strongly believe your ennemies should have their own script gathering all the needed information. Thanks to this script you will be able to give a behaviour to your ennemies. Isn't what you will have to achieve in the end?
Follow this Question
Related Questions
How do i give Coordinates (x, y) to an Array 1 Answer
Ways to make OnMouseDown (or a single script) differentiate between different colliders/sprites 1 Answer
c# - List with multiple types - Trading Engine - Stock Simulator 2 Answers
variable not being changed outside of a method. [C#] 3 Answers
Trigger Sound more than Once 0 Answers