Jump to content
  • 0

make scaleable prim move


phippsj10
 Share

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

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

Question

I want to make a prim you click on get as large as the prim behind it, then when you click it again, the prim gets smaller.  I want the larger and smaller action of the prim to be scaleable with the back board prim, this is what I have so far, what else do I need?

 

integer on = TRUE;
default
{
touch_start(integer total_number)
{
if(on == TRUE)
{
llSetScale(llGetScale()+<2.82,0,1.7>);
llSetPos(llGetLocalPos()+<.45,0.01,-.8>);
on=FALSE;
}
else if(on == FALSE)
{
llSetScale(llGetScale()-<2.82,0,1.7>);
llSetPos(llGetLocalPos()-<.45,.01,-.8>);
on=TRUE;
}
}
}

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Many things, depending on what your setup looks like.  I assume that the prim you're changing is linked to the prim behind it, since you're using llGetLocalPos.  If you test your script, you'll find that llSetPos will fail in one of two ways.  Either it won't do anything at all (most likely) or it will move to someplace you don't expect. After all, you are trying to set its regional position with llSetPos.  Also, you haven't corrected for the rotation of either prim, so unless you happen to have things at ZERO_ROTATION, you'll end up in an odd place.  Then, of course, your scaling is done by a constant factor that you'll have to change if you ever resize the backboard prim.  You'll probably want to get its scale and modify the front prim proportionally.  You'll also want to move the front prim by a distance that is proportional to the sizes of both prims, so they don't bump into each other.

Take a look in the LSL Portal at llGetLinkPrimitiveParams and llSetLinkPrimitivePamarmsFast.

BTW, a nice question like this ought to go in the LSL Scripting forum.  That's exactly what it's for.  ;)

  • Like 1
Link to comment
Share on other sites

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

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
 Share

×
×
  • Create New...