Page 1 of 1

Possible to set RingArea attractor_x via script?

Posted: 24 Sep 2012 04:18
by notlion
Hi, guys! New to Lemur here.

I'm trying to implement a 'hold' behavior on a RingArea. I want the attractor position to be set to the current x,y when I toggle a switch on. Problem is, the attractor_x and y don't seem able to be set with setattribute. Is there another way? If not then I guess this is a feature request ;)

Thanks!
ryan

Re: Possible to set RingArea attractor_x via script?

Posted: 24 Sep 2012 06:29
by Macciza
Hi
Yes you can do it by scripting in the variable area - see the example attached.
MM

Re: Possible to set RingArea attractor_x via script?

Posted: 24 Sep 2012 06:43
by notlion
Thank you! I ended up getting it working by making two scripts on the Switch:

Code: Select all

// On
velocity.attraction_x = velocity.x;
velocity.attraction_y = velocity.y;

Code: Select all

// Off
velocity.attraction_x = 0.5;
velocity.attraction_y = 0.5;
Love that I can code this right on the controller, instead of in my app.

ryan