Lance Shadow Posted July 7, 2015 Share Posted July 7, 2015 Hi, I'm having an issue when it comes to using llGetPos() and llRezObject() with an object that is multiple prims. What I'm doing is having an object rez a copy of itself out when it's sat on, but when I use llGetPos() on an object with multiple prims, it seems to be returning the position of the root prim (which the script is in) instead of the linked object as a whole. This causes the new object as a whole to be rezzed out relative to the root prim's position, causing the object to be a little higher in this case with each new object that's rezzed out. Is there a function that returns the position of the object as a whole or a way to script it to figure out that offset automatically? Or do I have to just manually offset the position? I'd like it to just use the position of the object as a whole so if I ever use a different object I don't have to manually go in and change the offset again. Link to comment Share on other sites More sharing options...
Lance Shadow Posted July 7, 2015 Author Share Posted July 7, 2015 Nevermind, I figured it out. I had to use llRezAtRoot() instead of llRezObject(). Link to comment Share on other sites More sharing options...
Rolig Loon Posted July 7, 2015 Share Posted July 7, 2015 llGetPos() will always return the region position of a scripted object. If you want the position of the object's root prim, you have to use llGetRootPos(). When you are rezzing a new object, you can use llRezObject to create the new object at the center of the existing one, or you can use llRezAtRoot to create it at the position of the object's root prim. Personally, I have very little need for llRezObject (in fact, I can't recall the last time I used it), because I almost always want the root prim of the new object to be relative to the root of the old one. Link to comment Share on other sites More sharing options...
Recommended Posts
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