Jump to content

Object Rezzing an Object issue, Rotation needs to be local not region?


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

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

Recommended Posts

Hey!

OK if you turn the rezzing object, the rezzed object goes off into space when it's rezzed.

How do I get the rezzing position to get the objects rotation instead of the regional?

Is that the issue? I think it is.

Snippet

 

llSleep(15);
llSay(0, "Prepared - " + obj2);
llRezObject(obj2,
llGetPos() + <.0,1.521,-.26>, <0.0,0.0,0.0>, <0.0,2.0,2.0,0.0>, 0);
llSay(0, "Please take your " + obj2 + " by touching it.");
llMessageLinked(LINK_SET, 0, "off", NULL_KEY);
llSleep(1);
llResetScript();}

Link to comment
Share on other sites

If I understand correctly, you want your rezzed object to have the same rotation as your rezzer. If so, your rezzing statement should be

llRezObject(obj2, llGetPos() + <.0,1.521,-.26>, ZERO_VECTOR, llGetRot(), 0);

I'm asssuming that you don't want your rez position to depend on the rezzer's rotation, or you would have written

llRezObject(obj2, llGetPos() + <.0,1.521,-.26>*llGetRot(), ZERO_VECTOR, llGetRot(), 0);

I have no idea why your rezzed object goes whizzing off to space, however.  That's not related to this question.  Does your rezzed object have a script in it that resets its location on rez?  That's a common strategy to use when you want a new object to end up more than 10m from the rezzer.

Link to comment
Share on other sites

I worded my question bady and you still answered it. Thanks: I do need the rezzed object to be set out relative to the rezzer. That's the issue. Right now it isn't. Soda machines need the soda to pop out the chute not the back.

First rezzed the chute will catch it. Turn the machine and the soda either falls on the ground or dies inside the machine never being seen.

A horrible fate for a soda that just wanted to be drunk, drunken, drank, whatever.

When I turn the rezzer the rezzed object is behind it or possibly inside it when rezzed

It seems to be getting it's center from some other place than the rezzer.

I'm 98% sure the Zero Vector call is what I was missing Thanks!

Link to comment
Share on other sites

No, it sounds like the llGetRot correction that you were missing.  If you simply write 

llGetPos() + <0.0,1.521,-0.26>

then your object will rez at an offset of <0.0,1.521,-0.26>, in the region's reference frame, relative to your rezzer's position.  If you rotate the rezzer, it will keep rezzing new objects at exactly the same spot, not recognizing that you have turned the rezzer.  If you want to adjust for the fact that you rotated the rezzer, you have to apply its new rotation to the offset:

llGetPos() + <0.0,1.521,-0.26>*llGetRot()

========

You already had the velocity = ZERO_VECTOR.  You just spelled it out the long way, as <0.0,0.0,0.0>.

Link to comment
Share on other sites

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

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...