Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Blinking eyes?

Tigerlady Jacobs
Ms. Tiger
Join date: 16 Aug 2004
Posts: 86
07-24-2005 15:07
does anyone know how to make the eyes blink? Like on a avie? I am creating some cartoony items and wanted the eyes to blink but dont know how to script it. :rolleyes:
SirEdward Vantongerloo
Registered User
Join date: 20 Jun 2005
Posts: 12
07-24-2005 18:10
Post in the scripting forum :)
Forseti Svarog
ESC
Join date: 2 Nov 2004
Posts: 1,730
07-24-2005 19:47
there are three ways to do this, but the best way to do it -- the least impact/laggy on the SIM servers -- is to use llSetTextureAnim

basically you take an image and divide it up into frames, like the frames on a movie reel, except in this case you don't have to have them all on one level going left to right, you can have multiple levels.

if you create you eye image in, say, a 2x2 grid (i.e. four frames), you might start with two frames with the eyes open, one half-closed, and one all the way closed.

when you create your prim (often done on a sphere) and texture it, you need to set the tiling and offset so that it points to the first frame - in this case tile 0.5, 0.5 and offset will be -0.25, 0.25.

you then use the llSetTextureAnim function and tell it how many frames your image has, how fast to play it, whether to loop, etc.

I have an example of all this in the merry-go-round building tutorial. I'll drop one on you.