Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

just need alittle help

racush Cheeky
Registered User
Join date: 23 Jan 2006
Posts: 23
07-08-2008 06:11
Well I've been looking around the forums for the past few days in hopes for any sort of info on how i should go about doing this but I've met with failure. I was wondering if maybe somebody could lend me some info on how i should limit the distance the prim is allowed to travel on the y axis. As the script stands now I have a detected grab allowing me to move a prim along the y axis but I'm unable to limit this movement to my needs.

this is what I've been able to work out witch may be incorrect but it dose allow me to move the prim.
CODE

default
{
touch(integer total_number)
{
if(llDetectedGrab(0) != ZERO_VECTOR)
{
vector pos = llGetLocalPos();
vector current = llDetectedGrab(0);
current.x = 0;
current.z = 0;
llSetPos((vector)pos + current);
}
}
}
Hewee Zetkin
Registered User
Join date: 20 Jul 2006
Posts: 2,702
07-08-2008 11:25
Try subtracting rather than adding. Might be a start in the right direction. ;)
racush Cheeky
Registered User
Join date: 23 Jan 2006
Posts: 23
07-08-2008 17:30
well I was looking to maybe have a way to specify 2 points that the prim will see as its maximum distance and minimum. I would like to drag this prim between the two but I'm unable to figure out how to really do so.
Ollj Fukai
Registered User
Join date: 4 Aug 2006
Posts: 5
07-08-2008 18:12
float miny =100.0;
float maxy =110.0;
//how you get and set this range is your problem, maybe in a"reset" function.

current.x = 0;
if (pos.y<miny) current.y=miny;
else if (pos.y>maxy) current.y=maxy;
else current.y=pos.y;
current.z = 0;
racush Cheeky
Registered User
Join date: 23 Jan 2006
Posts: 23
07-08-2008 21:52
ah thank you for the info, I should be able to work something out with that.