I'm trying to add 2 states and a state switch to all the layers in my array but it's only working with the first layer in the array.
I think change pin.states.current to this.states.current
If this.states.current is "active"
Super speedy response, cheers! Do you mind explaining what "this" is and if "is" similar to using "=="
P.S it worked
Yes "is" is basically coffeescript version of == and... "This" which you're already using is just referencing the item that fired the event.
If you use pin like you were its going to use the last pin that was set in your loop... Not the one that was there during that loop. The context gets lost. That's why you need "this" so it's self referencing.
Coffeescript.org can give you more info on operators.
Ah awesome, got it
Siavash Shabanipour If the pin has only two states, then you probably don't need to explicitly set the state by name, just cycle through using this.states.next()