In search of texture change on touch script for mesh
- Kimm Starr
- Posts: 266
- Joined: Wed Jan 30, 2019 7:59 pm
- Has thanked: 365 times
- Been thanked: 451 times
In search of texture change on touch script for mesh
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!
-
- Posts: 1314
- Joined: Sun Dec 23, 2012 2:26 pm
- Has thanked: 1134 times
- Been thanked: 1142 times
Re: In search of texture change on touch script for mesh
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
- Kimm Starr
- Posts: 266
- Joined: Wed Jan 30, 2019 7:59 pm
- Has thanked: 365 times
- Been thanked: 451 times
Re: In search of texture change on touch script for mesh
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!
- Luna Lunaria
- Posts: 100
- Joined: Thu Mar 16, 2017 1:02 am
- Has thanked: 60 times
- Been thanked: 160 times
Re: In search of texture change on touch script for mesh
Let me know if that works Kimm. If not, I have one that I use all the time