|
Leyah Renegade
Live Musician
Join date: 2 Nov 2006
Posts: 125
|
08-31-2007 10:52
Hey all,
I have some small items like appliances that have scripted doors that open and close, and I'd like to be able to sell them. However the doors have to be unlinked from the rest of the object to work properly. That means there's no easy way for the buyer to just rez the item and have it work - either they have to unlink the door or it has to be separate and they have to put it in the right place.
How do you guys handle this problem? Is there some way to link a door that I'm missing?
|
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
08-31-2007 11:08
Run a search, this has been discussed many times. There are several ways to approach this problem. The simplest is probably to cut the door prim correctly, so it appears to turn on an edge when actually it's turning around its center. Then you need to write the script correctly, i.e. handle the rotation in the child prim correctly so it opens/closes correctly no matter which way the main object is pointing. You should find everything you need in old posts on this forum.
|
|
Leyah Renegade
Live Musician
Join date: 2 Nov 2006
Posts: 125
|
08-31-2007 11:31
I do have the door prim cut correctly and it works - it rotates on edge. Just not sure how to get it to rotate by itself rather than having the entire linked set rotate. I did search old posts but maybe wasn't using the right search terms? I couldn't find anything other than to use a rezzer.
|
|
Shadow Subagja
Registered User
Join date: 29 Apr 2007
Posts: 354
|
08-31-2007 11:39
there are localrot functions that let you move the rotation to the current prim within the linkset. Thats probably the bit you're missing.
|
|
Leyah Renegade
Live Musician
Join date: 2 Nov 2006
Posts: 125
|
08-31-2007 11:40
Ahhhh that was it, thank you! Changed all my Get and SetRot's to LocalRot's and all is well. 
|
|
Ziggy Puff
Registered User
Join date: 15 Jul 2005
Posts: 1,143
|
08-31-2007 13:33
There's also the Wiki, which has an entire section dedicated to rotating child prims in linked objects. http://lslwiki.net/lslwiki/wakka.php?wakka=ChildRotationFrom: someone Child Rotation
Child rotation is the rotation of a child prim in relation to its parent (instead of in relation to the world). This comes into play when moving (rotating) parts that are in a linked object that can itself be rotated.
Examples
An example of child rotation is a car door. No matter what direction the car faces, the doors are probably expected to always open outwards and rotate around their hinges. That's a useful page to read if you ever need to do this with an attachment, because the techniques are different (due to SL bugs/quirks).
|
|
Wildefire Walcott
Heartbreaking
Join date: 8 Nov 2005
Posts: 2,156
|
08-31-2007 13:40
Leyah must have been using single-prim doors. Things get interesting when you're dealing with multi-prim doors. Still do-able, just a little more involved.
|
|
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
|
08-31-2007 20:04
Another issue worth mentioning, I think, is that having rotating/moving prims such as doors linked to the rest of an object can tend to induce prim drift in the whole structure over time.
This, as well as the fact that builds over a certain size will eventually become unlinkable in one single piece, is a good reason to use a build-rezzing device such as Rez Foo, Rez Faux, or Builder's Buddy (this last one is available free on the forums). These devices allow you to package up a building in several pieces (including unlinked doors) such that the customer can rez them into place with just a click. Might be worth looking into.
|