Change attributes with location of actor
craps
Member Posts: 353
I have an actor who moves across the screen and when he's at x = 160 I have the following. Which turns on a light using interpolate.
(attribute.self.position.X = 160)
(change attribute to lights = true)
I would like to have the light go off again when the actor moves to a position greater than 170 or back less than 160.
I currently does work when the actor "hits" x = 160
Thx
(attribute.self.position.X = 160)
(change attribute to lights = true)
I would like to have the light go off again when the actor moves to a position greater than 170 or back less than 160.
I currently does work when the actor "hits" x = 160
Thx
Comments
(attribute.self.position.x is equal to or greater than 170)
(change attribute to lights = false)
Actor who moves -
rule-
attribute.self.positionX = 160
change attribute.game.lights - to - TRUE
rule- any
attribute.self.positonX = 170
attribute.self.positonX = 150
change attribute.game.lights - to - False
Works fine for moving to the right ( light goes on at 160 off at 170) but does not go off again when moving to the left and hit 150. It stays on. But then at 170 it does go back off again when moving to the right.
Is this the best way to interpolate and image alpha 0/1 according to an actors position? I would like to do something like this multiple times across a screen.
Ideas?
make one rule and have when self positions x is > or equal to 151
and when attribute self position x is < or equal to 169
change attribute game lights to true
then in the otherwise sectoin of the rule have a change attribute behavior change game.lights to false
Is it an interpolate thing - if the actor moves too fast through these points it seems there is not enough time to turn the attribute false?