Jump to content

Need Help with object rotation when worn vs when rezzed on the ground.


Bells Semyorka
 Share

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

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

Recommended Posts

Hi There! 

Ive created a cupcake display to place my store items inside instead of a shopping bag. I have it currently set up where it is worn and there is an animation attached. When the customer is ready to have the items delivered all they have to do is click to recieve the contents. The problem I am having is trying to make a script in the event someone does not wear the cupcake display but instead wants to rezz it on the ground. Ideally It would have a set rotation when worn and then a diffrent rotation when rezzed on the ground. I have tried searching for a couple of days online and havent found an answer to help. I am enclosing two photos to try to Illustrate what I am trying to do. Also I have very basic knowledge of scripts, I am not savvy on them at all. Helpcupcakes.jpg

Looks like this when worn.

 

Snapshot_002.jpg

Please Help.

Link to comment
Share on other sites

Thank you for the feedback Darkie. I tried working with this LSL function, but it isn't entirely what I am looking for. This is for in the event someone does not want to allow their object to animate them and they do not want to wear it. They just want it rezzed in world to click and open. I am trying to find a way for the cupcake display to always be upright and looking it's best as opposed to upside down and unprofessional and messy. Im not sure if it's even possible within SL. I've never seen it before; but perhaps I haven't been looking hard enough.

Link to comment
Share on other sites

I have made something very similar (a tray of drinks you can either carry about or have rezzed on a table).

It works exactly as Darkie suggests.   That is, it checks, in the on_rez event, if it's attached or not.   If (llGetAttached()==0) -- if it  is not attached -- then it calls llSetRot() to set itself to the appropriate rotation.

Link to comment
Share on other sites

Take a look at the colorful chart at https://wiki.secondlife.com/wiki/Rotation#Single_or_Root_Prims_vs_Linked_Prims_vs_Attachments . When you use llSetRot or llSetLocalRot or their equivalents in SLPPF to set a rotation on a rezzed prim (on the ground), the reference system is the object's global rotation. If you use the same functions to set the rotation of an attached object, the reference frame is the rotation of the attachment  point on the avatar.  That's why you can't use the same numbers for both conditions. As Darkie and Innula say, you have to determine first whether the object is worn or free-standing. Then apply the appropriate rotation. If your object's +Z is supposed to be vertical, you ought to be able to llSetRot(ZERO_ROTATION) for the free-standing case.

Link to comment
Share on other sites

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