Jump to content

Is it possible to detect mouse pointing at a prim?


GloriaGlitter
 Share

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

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

Recommended Posts

Is it possible to detect when a user's mouse points at a prim?  I want to be able to change the texture of a prim when a mouse points at it.  I couldn't find a detection event for this but It should be possible since the cursor changes shape when pointing at an object with a sit pose in it for instance.  Thanks.

Link to comment
Share on other sites

I can confirm there's no way to detect if someone's mouse is hovering over something, but there is a way to detect if someone is aiming at something in mouselook, or looking at it in free view.

It requires regularly doing a raycast check according to their camera's position and rotation.

http://wiki.secondlife.com/wiki/LlCastRay
http://wiki.secondlife.com/wiki/LlGetCameraPos
http://wiki.secondlife.com/wiki/LlGetCameraRot

This requires that the thing that's doing the checking has permissions from the avatar in question.

Altarnatively, you can detect other avatars' mouselook remotely (no attachment/permissions required) if you just get their current rotation.

Edited by Wulfie Reanimator
  • Like 1
Link to comment
Share on other sites

Molly's right.. There is no mouse_over function in LSL. However, if you own the object that you want to texture, you can certainly fake it.  Use llCastRay to detect the UUID of whatever the user has clicked on while in mouselook, and then send a message to the object that contains the color vector or the texture UUID that you want to apply. A script in the receiving object can do the work of actually changing the color or texture.  Of course, the simpler solution (without llCastRay) would simply mean clicking on the object and having its script send you its UUID.

Link to comment
Share on other sites

This is my project - I'm making a TP board for a store elevator - if you click on say 'Floor 3' button then you go to floor 3.  Just thought it would be neat to glow the button as the mouse hovered over it so the user could be sure of clicking the right button.

  • Like 1
Link to comment
Share on other sites

You are about to reply to a thread that has been inactive for 1162 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...