gustav2005 Posted November 29, 2014 Share Posted November 29, 2014 I've been working on an object with touch on/off function to control the transparancy of one face of the object.The problem is, everytime I rez the item, the whole object goes 100% transparant for the very first click. It turns up when I select the object and "edit" it. Then, after that, the object works OK. The script is very simple but, therefore, I can't figure out why that malfunction happens only for the very first time. Could someone help me to figure out why this happens and how to avoid that?The script is like this righ now.integer ON;default{ state_entry() { llSetAlpha(1.0, ALL_SIDES); } touch_start(integer total_number) { ON = !ON; if (ON) { llSetAlpha(0.0, 1); llPlaySound("bell",0.3); } else { llSetAlpha(1.0, 1); llPlaySound("bell",0.3); } }} Link to comment Share on other sites More sharing options...
Dora Gustafson Posted November 29, 2014 Share Posted November 29, 2014 If you want it to go non transparent on rez use the example from the wiki: default{ on_rez(integer start_param) { // Restarts the script every time the object is rezzed llResetScript(); }} If you don't want it to go transparent on the first click move the toggle ON flag to the end of the touch event handler where it will toggle after use Link to comment Share on other sites More sharing options...
gustav2005 Posted November 29, 2014 Author Share Posted November 29, 2014 Oh, thank you very much Dora! It stopped the awkward reaction of the object. It still has the texture loading problem, but I think that is a lag caused by the server. Reducing the texture size from 512x512 to 256x256 might solve the problem..... (I haven't tried it yet though). I really appreciate your help Link to comment Share on other sites More sharing options...
Recommended Posts
Please take a moment to consider if this thread is worth bumping.
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now