In search of texture change on touch script for mesh

Post requests for goods or services
Post Reply
User avatar
Kimm Starr
Posts: 214
Joined: Wed Jan 30, 2019 7:59 pm
Has thanked: 307 times
Been thanked: 388 times

In search of texture change on touch script for mesh

Post by Kimm Starr »

In search of texture change on touch script for mesh. Not sure if this is possible because I have searched high and low for one with no luck. I created an Elephant Man Animesh and I want people to be able to touch his hood and it turn clear (transparent) to reveal his head. Thanks in advance for any help with this. Willing to pay for the script.
These users thanked the author Kimm Starr for the post:
Ilan Tochner
I'm obsessed with Animesh and soon you will be too!
Graham Mills
Posts: 1314
Joined: Sun Dec 23, 2012 2:26 pm
Has thanked: 1134 times
Been thanked: 1141 times

Re: In search of texture change on touch script for mesh

Post by Graham Mills »

With the proviso that I've never tried this with mesh, I'd guess it's a matter of changing the texture on a particular face using llSetTexture (assuming it's not a linkset)? I guess some animated reveal or dissolve might be appropriate but that's the basics afaik.

Code: Select all

string hoodTexture = "1bw";//names of textures in object inventory
string faceTexture = "2bw";
integer face = 0;// face to be textured

default
{
    on_rez(integer p)
    {
        llSetTexture(hoodTexture, face);
    }
    
    touch_start(integer i)
    {
        if (llDetectedTouchFace(0) == face)
        {
            if (llGetTexture(0) == faceTexture)
            {
                llSetTexture(hoodTexture, face);
            }
            else
            {
                llSetTexture(faceTexture, face);
            }
        }
    }
}
These users thanked the author Graham Mills for the post:
Ilan Tochner
User avatar
Kimm Starr
Posts: 214
Joined: Wed Jan 30, 2019 7:59 pm
Has thanked: 307 times
Been thanked: 388 times

Re: In search of texture change on touch script for mesh

Post by Kimm Starr »

Thanks so much Graham, I'll give this a try now.
These users thanked the author Kimm Starr for the post:
Graham Mills
I'm obsessed with Animesh and soon you will be too!
User avatar
Luna Lunaria
Posts: 92
Joined: Thu Mar 16, 2017 1:02 am
Has thanked: 50 times
Been thanked: 151 times

Re: In search of texture change on touch script for mesh

Post by Luna Lunaria »

Let me know if that works Kimm. If not, I have one that I use all the time
Image
VISIT LUNARIA EMPORIUM ON THE KITELY MARKET HERE: https://www.kitely.com/market?store=13957705
Post Reply