Jump to content

rez object


ImojenSander
 Share

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

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

Recommended Posts

ok hoping someone can help, i just want to rez a simple object by pressing a buttin with the below script in it
Now the object is called hand and its in my objects folder with permissions copy no mod no trans, but keep getting this when button is pressed  Could not find object 'hand'. What am i doing wrong.

thanks

// Rez an object on touch, with relative position, rotation, and velocity all described in the rezzing prim's coordinate system.
string object = "hand"; // Name of object in inventory
vector relativePosOffset = <2.0, 0.0, 1.0>; // "Forward" and a little "above" this prim
vector relativeVel = <1.0, 0.0, 0.0>; // Traveling in this prim's "forward" direction at 1m/s
rotation relativeRot = <0.707107, 0.0, 0.0, 0.707107>; // Rotated 90 degrees on the x-axis compared to this prim
integer startParam = 10;
 
default
{
    touch_start(integer a)
    {
        vector myPos = llGetPos();
        rotation myRot = llGetRot();
 
        vector rezPos = myPos+relativePosOffset*myRot;
        vector rezVel = relativeVel*myRot;
        rotation rezRot = relativeRot*myRot;
 
        llRezObject(object, rezPos, rezVel, rezRot, startParam);
    }
}
Link to comment
Share on other sites


ImojenSander wrote:

 

Now the object is called hand and its in my objects folder with permissions copy no mod no trans,

Do you mean that you are expecting to rez the "hand" while it is in your inventory objects folder?

If so, that's not how it works. You cannot rez items directly from your inventory with a script.

You have to put a copy of the item you want to rez into the item that is running the script along with the script itself. Drag it from your inventory and drop it into the button item's contents where the script is.

Link to comment
Share on other sites

Exactly. :smileywink: That's why I said "... is in the same prim in the object that your script is in".  I assume that the OP knows that a rezzer has to contain whatever it is supposed to rez, although I agree that it's a little worrisome that he says that "hand" is in its "Object" folder.  Prims don't have Object folders.

If spelling is correct (including not having any errant blank spaces) and if the "hand" is actually where it is supposed to be, that script should work.

Link to comment
Share on other sites

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