Hello all! I have a small problem. In my game, the player will collide with an enemy and move to the battle screen, where battle will take place (obviously).
Three enemies will be able to be fought at any one time, and this would be changed by having the enemy variables as a gameObject for the enemies and make it static so that it can be changed by other objects.
To my dismay, I find that GameObject variables cannot be static. Is there anyway around this?
You don’t need them to be static, you can just use a Singleton Pattern for a central manager and make them public there
In my working script I have
static var damageText : GameObject;
Which other scripts can access through Class.damageText
What exactly is the problem you’re experiencing with static GameObjects?