Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

RezObject/GetPos bad interaction?

Luki Ronmark
Registered User
Join date: 18 Jun 2007
Posts: 8
06-19-2007 16:55
I am currently trying to erect a structure recursively ... or as much so as I can manage. I have a certain type of object, with some additional copies of itself in its inventory. On click, I want it to rez these objects at specific distances from itself. The problem im currently experiencing is, with code along the lines of

llRezObject("name", llGetPos() + <a,b,0>,NULL,NULL,garbage_here);

the other objects have the correct x and y location, but are all noticeably off in the z direction. However, of the several objects rezzed using this method (with slightly varying a, b, and of course "name";) they have the same, predictable z.

So ... any ideas what may be causing this? both the rezzing and rezzed objects are part of a link ... does it have something to do with the way position is calculated for a linked object?
Qie Niangao
Coin-operated
Join date: 24 May 2006
Posts: 7,138
06-19-2007 17:15
If the rezzed objects are linksets, you probably want to use llRezAtRoot() to position the root prim, instead of the geometric center of the linkset which llRezObject() does.
Anti Antonelli
Deranged Toymaker
Join date: 25 Apr 2006
Posts: 1,091
06-19-2007 18:13
Another possibility: are you rezzing objects which should end up partly buried in the ground? (think house foundation) As far as I know, there is no scripted way to position an object such that its center of gravity is below ground level, and I know in the case of llSetPos the object ends up at a vector with a different z value such that it's not buried too much.
Luki Ronmark
Registered User
Join date: 18 Jun 2007
Posts: 8
06-19-2007 19:02
The problem was solved by RezAtRoot ... thanks!