Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

moving a Physical platform

Kaylan Draken
Registered User
Join date: 2 Dec 2006
Posts: 127
04-28-2008 12:10
Hi everybody,

I want to make a platform that exist of several prims.
On the platform are people standing/walking/dancing.

When i touch it the platform get Physical and i want to move it 50m up.
The problem is that the platform drift while moving up:((
is it possible to move a physical platform to move up without drifting?

The code i used to move the platform up is:

llSetStatus(STATUS_PHYSICS, TRUE);
llSetStatus (STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);
llMoveToTarget(llGetPos() + <0.0, 0.0, 50>, 60);
llStopMoveToTarget();
llSetStatus(STATUS_PHYSICS, TRUE);
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
04-28-2008 12:17
From: Kaylan Draken
llSetStatus(STATUS_PHYSICS, TRUE);
llSetStatus (STATUS_ROTATE_X|STATUS_ROTATE_Y|STATUS_ROTATE_Z, FALSE);
llMoveToTarget(llGetPos() + <0.0, 0.0, 50>, 60);
llStopMoveToTarget();
llSetStatus(STATUS_PHYSICS, TRUE);

That's the whole script? You shouldn't call llStopMoveToTarget & turn off physical right after calling llMoveToTarget...

Instead, right before the llMoveToTarget call, do "llTarget (llGetPos() + <0.0, 0.0, 50.0>, 1.0)" then add something like this...

CODE

at_target (integer target, vector targetPos, vector here)
{
llTargetRemove (target);
llSetStatus (STATUS_PHYSICS, FALSE);
llStopMoveToTarget();
}
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Kaylan Draken
Registered User
Join date: 2 Dec 2006
Posts: 127
04-28-2008 12:28
i found a script at lslwiki but that has the same problem for me.
i want to make a platform that moves between 4 50m high poles
the problem is that the platform drift and get stuck at the poles

the script i found is:
integer targetID;


default
{
touch_start( integer total_number )
{
llSetStatus(STATUS_PHYSICS, TRUE);
vector destination = llGetPos() + <0, 0, 50>;
float range = 0.5;
targetID = llTarget( destination, range );
llMoveToTarget( destination, 60 );
}

not_at_target()
{
llWhisper(0, "Still going";);
}

at_target( integer number, vector targetpos, vector ourpos )
{
llSay(0, "We've arrived!";);
llTargetRemove(targetID);
llStopMoveToTarget();
llSetStatus(STATUS_PHYSICS, FALSE);
}
}

Thanks Meade for your help.
Meade Paravane
Hedgehog
Join date: 21 Nov 2006
Posts: 4,845
04-28-2008 12:37
If the poles aren't phantom, the platform is going to bounce off or get stuck on them...

What do you mean by 'drift'? Like the wind is blowing it around?
_____________________
Tired of shouting clubs and lucky chairs? Vote for llParcelSay!!!
- Go here: http://jira.secondlife.com/browse/SVC-1224
- If you see "if you were logged in.." on the left, click it and log in
- Click the "Vote for it" link on the left
Kaylan Draken
Registered User
Join date: 2 Dec 2006
Posts: 127
04-28-2008 12:51
Thanks Meade,

That was the trick i forgot to make the poles phantom :)
Have learn something new today :)

Thanks