Hi! I am having a problem with multiple instances acting weird and interrupting each other's intended actions. The enemy event sheet contains a number of functions and as far as I understand it functions disregard instance.UID unless it is passed onto the function? So my question is: how do I pass instance UID onto a function to prevent the contents of the function to affect every instance of an object?
Specifically, when an enemy turns around (turning around is written in a function) every other enemy that don't need to turn around at that moment do so anyway and I guess it's because the function affects every instance because it disregard UID?
I have searched but the only answers I've found has been very hard to understand or explained poorly.
Thanks in advance!
Develop games in your browser. Powerful, performant & highly capable.
Use the Plugin "Function" Parameter Feature. You can pass any value you want to any function.
Click on "Add Parameter" at Call Function Window. And inside a Function you can use the expression "Function.Param(n)" (n = number / index of added parameter)
You can also buffer your uid number in a variable.
Thanks for the quick answer DAG!
What I did was:
1) in the function call I added as a param(0) : "instance.UID"
2) in the function I picked instance UID by Param(0) ..
..and it works! Thanks DAG