Describe the bug
After creating an object, setting object variables apllies to all instances instead to last created one.
This results into all creatures moving towards last players (who created last creature) oponent. Expected result is, that creatures should keep moving toward each players oponent.
Yes, it is Players is object group of LilWiz and WizardFemale. Creatures is object group of Goblin and Ice zombie. Player id is assigned directly on object:
You are using a condition “The variable mana of Players > Goblin.mana_cost”
First of all, this is not a good practice as if no instance of Goblin exists on the scene, Goblin.mana_cost will return 0
(this is an instance variable, remember that it can be different per instance on the scene, and not fixed on the object, so if no instance exists the variable does not exist)
Secondly, by doing so, you are picking all the Goblin instances on the scene as it’s trying to find which mana_cost of which instance makes this condition turns true, hence your result.
You should save the mana_cost of your objects in scene variables, in a Structure for instance, as they are constants and are not dependent on the instance of your objects.
I want to thank you one more time. You helped me to resolve my problems. I would not expect object picking by conditioning value comparison and using one argument objects variable.