I got it working with 2 instances, but for more i get stuck.
The aim is, if X instances of an object are nearby EACH other these should all perform an action once, and switch back when they are out of the range to each other.
Any help welcome :)
PS: Guess I could make it if I would know how to override the loopindex inside a for-Loop, or a command like "nextLoop".
Develop games in your browser. Powerful, performant & highly capable.
+ local variable X = Object (First Instance)
+ local variable Y = Object (First Instance)
for each ordered by distance(X, Y, Object.X, Object.X)
if (distance(..) == 0)
set X = Object
set Y = Object
If you have any question aks me, it works fine for me
yes, would you like to give me a screenshot of your event?
I am not sure how you check the distance between all instances here.
for each ordered by distance(X, Y, Object.X, Object.Y)
just checks from the first instance, not all instances to each other.
also only the first nearest instance is picked. If you leave the loop there, maximum 2 instances can do an action.
many thanks for additional information!