miércoles, 30 de octubre de 2013

Blink

Re: Making an object "blink"

Postby Ivan » Wed Aug 28, 2013 2:17 pm
Hi, RpT!
I am not sure if I understood what you meant but maybe something like this is what you are looking for.
CODE: SELECT ALL
color =
{
    scene.my.blink ? {
        (math.toint(sim.tick / 60) % 2 == 0) ? {
            [1, 0.5, 0, 1.0]
        } : {
            [0.25, 0.125, 0, 1]
        }
    } : {
        [0.25, 0.125, 0, 1]
    }
}

The number that divides sim.tick determines the blinking frequency. There is 60 ticks per second, depending on sim.frequency.
Image
User avatar
Ivan
 
Posts: 201
Joined: Tue Oct 06, 2009 2:01 pm
Location: Croatia

No hay comentarios:

Publicar un comentario