Jump to content

Script stops working when object is worn


Rififi
 Share

You are about to reply to a thread that has been inactive for 704 days.

Please take a moment to consider if this thread is worth bumping.

Recommended Posts

I have an article of clothing with a very simple touch_start script that prints a message to local chat when someone clicks on it. It works fine when rezzed by itself, but when worn, it does nothing.

I'm a novice when it comes to LSL, so use small words, please.  :)

Link to comment
Share on other sites

Rigged mesh can't be touched when it's worn without right click + touch from the menu, and even right-clicking is not reliable.

If you need a touch function on rigged, worn clothing, you need to use non-rigged invisible prims to give a touch target: a box or sphere with 100% transparency positioned around the correct location works fine.

Edited by Frionil Fang
Link to comment
Share on other sites

18 minutes ago, Frionil Fang said:

a box or sphere with 100% transparency positioned around the correct location works fine.

This - but I'd be careful about the 100% transparency part, as newer viewers (port-Performance Improvements) will often discard objects which are 100% transparent (Touch events I believe are still passed, but something to think about!)

The method I came up to get around this is to set the touch target to 99% transparent, then apply a half-transparent texture atop that (ideally, with the edge of the texture fully transparent so the edges of the touch target are invisible) - the result will be a touch target that you cannot see, but can always reliably click on to fire touch events.

  • Like 2
Link to comment
Share on other sites

I see I could have been clearer in my initial post. Clothing might imply rigged mesh, but the object containing this script is a bracelet composed of prims.

default {
  touch_start(integer num_detected) {
    string toucher = llGetDisplayName(llDetectedKey(0));
    llSay(0, toucher + " clicked on the bracelet.");
    llSay(0, "Actual message edited to protect the guilty");
  }
}

As I said, it works fine when it's not being worn. Not a lot that could go wrong. :)

Link to comment
Share on other sites

4 hours ago, Rififi said:

As I said, it works fine when it's not being worn. Not a lot that could go wrong. :)

the bracelet surface may be obscured by something else you are wearing.  Try wearing the bracelet without wearing anything else. Try zooming your viewer camera to different angles. Try doing this on more than one region. Try putting the script into a standard box prim and wearing the box on the attachment point

 

 

Link to comment
Share on other sites

26 minutes ago, Mollymews said:

"The bracelet surface may be obscured by something else you are wearing. "

 

 

Yep, that's the problem. Thanks.

I don't know what to do about it, however, as the obscuring element is something I always wear (my hair), which is not modifiable. I guess the best I can do is chalk this up as a learning experience.

collar_obscured_by_hair.png

Link to comment
Share on other sites

what Innula said.  I have ears that are linked to a large transparent prim that sits above my head to enable touch more easily. I also have a dance attachment made the same way, the transparent prim offset behind my body

 

edit add.  If by bracelet you mean the collar in your pic.  Then link the transparent touch prim so that is under your chin and out a bit from your neck/chest area, clear of your hair when you are standing in your basic rest pose position

Edited by Mollymews
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 704 days.

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
 Share

×
×
  • Create New...