Hikaru Yamamoto Posted December 13, 2013 Share Posted December 13, 2013 Hello, I make mesha avatars and I'm looking for a script that will make a sphere twitch like an eye so I can use them on my avatars to make them more lifelike. I will need it full perm of course. If you can please provide me with a script, make one for me, or point me to where I can buy one, it will be much appreciated. Please IM me or reply here. Link to comment Share on other sites More sharing options...
Vanessa Hallison Posted December 15, 2013 Share Posted December 15, 2013 Correct me if I'm wrong, but I believe that the eye lid twitches, not the actual eye ball itself... so if you wanted to make your avatars eye twitch, then you would need a script for mesh eye lids. Link to comment Share on other sites More sharing options...
Madelaine McMasters Posted December 15, 2013 Share Posted December 15, 2013 You're correct, Vanessa. Twitching the eye would result in eyes that stay open, but change appearance. Even if the "closed" appearance of the eye matched the skin, the eyelids/lashes would remain open. That would be quite unnatural looking. Link to comment Share on other sites More sharing options...
Hikaru Yamamoto Posted December 17, 2013 Author Share Posted December 17, 2013 Perhaps my post was confusing. I apologize. What I mean is that I create entire mesh avatars, meaning there is no avatar skin to match its just mesh on mesh and I have created seperate eye lids that blink. I just need the eye balls to move as if they were real instead of just staring ahead. Link to comment Share on other sites More sharing options...
Madelaine McMasters Posted December 17, 2013 Share Posted December 17, 2013 Aha! The wiki's llLookat() page contains a script for making an object look at the closest avatar. If you drop that script into a prim eye, it may do what you wish. If you want saccade movement, you might add a small random amount to the X and Y axis components of the vector that's being added to the target avatar's detected position. Here's the unmodified script from that page... // Same as above, but for use inside a child prim or the root of an attachment.// Make the child or attachment look at nearest Avatar. default{ state_entry() { llSensorRepeat("", "", AGENT, 20.0, PI, 0.2); } sensor(integer total_number) { vector p = llGetPos(); llLookAt(p + (llDetectedPos(0) + <0.0, 0.0, 1.0> - p) / llGetRootRotation(), 3.0, 1.0); }} Here's the script with the addition of random saccade... // Same as above, but for use inside a child prim or the root of an attachment.// Make the child or attachment look at nearest Avatar.integer saccadeX = 0.1;integer saccadeY = 0.1;default{ state_entry() { llSensorRepeat("", "", AGENT, 20.0, PI, 0.2); } sensor(integer total_number) { vector p = llGetPos(); llLookAt(p + (llDetectedPos(0) + <llFrand(saccadeX), llFrand(saccadeY), 1.0> - p) / llGetRootRotation(), 3.0, 1.0); }} I have not tried this, so it may not compile, and if it does, it may not work. But it's a start. Good luck! Link to comment Share on other sites More sharing options...
Hikaru Yamamoto Posted December 17, 2013 Author Share Posted December 17, 2013 Thank You! Link to comment Share on other sites More sharing options...
Madelaine McMasters Posted December 17, 2013 Share Posted December 17, 2013 Don't thank me yet. It may not do what you want. I have no idea whether the saccade values (which are offsets from the X/Y position of the avatar) are proper values, nor whether the random movement will look at all natural. I also don't know where the eye will point if there is no avatar in range. It might just roll back into the head! You may have to invite a friend over to give the script someone to look at. That wiki page I linked also has the script for a non-attached prim. You might try putting that script in a sphere rezzed on the ground to see how it works, it'll be looking at you, and won't require a second avatar. But as I said, it's a start. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now