Jump to content

Bring obj to its original position after applyimpulse


mansoor50
 Share

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

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

Recommended Posts

So am new and learning lsl.

i created a cylinder, did the applyimpulse ... and till this point...it works fine.

Now i want to bring the prim back to its original position. code attached below:

vector init_pos;
applyimpulse() {
	init_pos=llGetRootPosition();
	//llSetStatus(STATUS_PHYSICS, TRUE);
	llSay(0,"Inside touch start"+(string) init_pos);
	llSetStatus( STATUS_DIE_AT_EDGE | STATUS_PHYSICS, TRUE);
	llSetStatus( STATUS_ROTATE_X,TRUE);
	llSetStatus( STATUS_ROTATE_Y,TRUE);
	llSetStatus( STATUS_ROTATE_Z,TRUE);
	llApplyImpulse(<0.,0.,1.>*10,0);
}
default
{
    state_entry()
    {
		llSay(0, "ApplyImpulse!");
		
    }
    touch_start(integer total_number)
    {
		applyimpulse();
		llSleep(5.);
	}
	moving_end()
	{
		llSay(0,"Inside move end"+(string) init_pos);
		llMoveToTarget(init_pos,1.);		
		//llResetScript();
	}
}

when i insert the moving_end block.....the prim remains in one place ... the impulse does not work either.

can anyone help?

Link to comment
Share on other sites

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