How to change speed of all Surface Effectors

But this isn’t a 2D question nor is it a SurfaceEffector2D question really; it’s a scripting question on how to access objects in arrays.

FindObjectsOfType returns an array. An array doesn’t have a “speed” property so what you’re saying above wouldn’t compile. You’d need to iterate the array and manipulate each object. I have no idea what you mean by your comment on using 's for plural.

Also, calling this is very slow as the docs state; if you’ve not added/removed these object types then you’re best to store the array somewhere for future reference.

Maybe you should ellaborate or post a snippet of real code using code-tags. Using code tags properly

1 Like