Jump to content

Linking opening/closing door to prim


GloriaGlitter
 Share

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

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

Recommended Posts

I have made a pirates treasure chest.  I have the base and the lid as two separate prims.  The lid opens and closes nicely.  Ideally I'd like to link the lid to the base so that if I move the chest, both parts move together and secondly so that you can click anywhere on the chest for the lid to open rather than just clicking on the lid.  When I tried linking the prims the whole chest turned over when I clicked it.

Link to comment
Share on other sites

You will have to use a script in the root prim to first detect which child has been touched, and secondly, when opening or closing the lid, to use local position and rotation of the child prim, not the linkset.

Look at Prim_pos_local and Prim_rot_local in the list of items to be detected by llGetLinkPrimitiveParams, and also look at the llDetectedLinkNumber for working out what has been touched and where it is, then llSetLinkPrimitiveParamsFast used with the link number and local positions and rotations will do what you want.

 

Link to comment
Share on other sites

a door swing script in the linked lid prim will do it. Where the lid is not the root prim

the Innula Zenokova / Void Singer script in the this thread on the first page is a good place to start.  Then can also look at the other door scripts from Rolig, etc for slow stepping the rate at which the lid opens

 

  • Like 2
Link to comment
Share on other sites

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