Changing color with speed

8x8n88x8n8 Member, PRO Posts: 81
edited November -1 in Working with GS (Mac)
So I have this actor that I want to change from white to red when it gets moving fast enough. Seems easy enough but GS is acting really weird.

Here's the code I've set up:

Rule: If ANY
Attribute self.linearvelocity.X < 500
Attribute self.linearvelocity.Y < 500
Attribute self.linearvelocity.X > -500
Attribute self.linearvelocity.Y > -500
Then
Change Attribute self.color.blue To: 0
Change Attribute self.color.green To: 0
Otherwise
Change Attribute self.color.blue To: 1
Change Attribute self.color.blue To: 1

For some reason when I test it only changes Blue to 0 when velocity reaches 500. The actor will turn red for a second then turn yellow. I'm stumped.

EDIT: Nevermind I figured it out :P

There was a piece of code left from an older version that was messing it up. I guess I'll leave this up in case anyone is wondering how to do this.
Sign In or Register to comment.