Can't figure out while loops

Hey guys,

I am using the city sample vehicles and I want to add toggleable police lights.

I want to add a loop so when the input is pressed once they will loop change red to blue and when it’s pressed again they return to default texture. In my mind this logic here should work but it throws the Infinite Loop Detected error everytime I try it

I’m trying to use a loop to do this and I haven’t actually used loops all that much maybe you guys could help out.


Default


Blue Material


Red Material

Use this instead:

Ok thanks I sort of have that working but how do I stop the timer by pressing L again

Like this :blush:

1 Like