Raena Parx Posted July 31, 2015 Share Posted July 31, 2015 Hi All. I have an object that animates an avatar on attachment using attach(key id).Can someone tell me the best way I can remove and delete this object so it no longer exists after it's done animating?(Not on avatar and not in avi's inventory). I've tried a LOT of trial and errors, but I am NOT a scripter, just a builder, and have still not found the solution. Thank you so much. Link to comment Share on other sites More sharing options...
Dora Gustafson Posted July 31, 2015 Share Posted July 31, 2015 llAttachToAvatarTemp() does just that: Quote: Follows the same convention as llAttachToAvatar, with the exception that the object will not create new inventory for the user, and will disappear on detach or disconnect. :smileysurprised::smileyvery-happy: 1 Link to comment Share on other sites More sharing options...
Raena Parx Posted July 31, 2015 Author Share Posted July 31, 2015 Thank you for your help. Although I like the idea, and it may be an option...I was hoping to not require to 'rez' the object first so rez permissions on land would not be an issue. Is there possibly another way? Link to comment Share on other sites More sharing options...
Rolig Loon Posted July 31, 2015 Share Posted July 31, 2015 Not really. If you attach an item from inventory, it detaches back to inventory. If you are trying to attach something that is already in world, you can't do it unless you own the object. You can fake it by scripting that object to be a rezzer, though. When a user clicks, it rezzes a copy of itself and immediately requests PERMISSION_ATTACH. When it receives permission, it attaches with llAttachToAvatarTemp, which effectively changes ownership temporarily but does not allow the user to detach it to her inventory. The script than requests PERMISSION_ATTACH|PERMISSION_TRIGGER_ANIMATION to get permission from the new "owner" to start and animation and (later) detach the object. There's an example script in the LSL wiki at llAttachToAvatarTemp. This sequence is much easier if you are working in an Experience, of course, because once the user has accepted the Experience you don't need to request her permissions every time. You can then script "autoattach" temp items using the strategy above and the user has no idea how it's done. Link to comment Share on other sites More sharing options...
Raena Parx Posted July 31, 2015 Author Share Posted July 31, 2015 That sounds awesome. I like the Experience idea too. I'll try working with that. Thank you so much for your help. Link to comment Share on other sites More sharing options...
Raena Parx Posted August 1, 2015 Author Share Posted August 1, 2015 Just wanted to say thank you again. I used the llAttachToAvatarTemp and it worked perfectly!!! THANK YOU 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