Jump to content

Adding Touch _Start & End to Script


Ava Royce
 Share

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

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

Recommended Posts

Hello Everyone,

Can someone please help me add a Touch _ Start & End into my script, so I can just click the object when I want it to do something? The rotation script I'd like to add it too is this:

default
{
state_entry()
{
llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); // Required to use llSetKeyframedMotion! (restart script once)
llSetKeyframedMotion([<-0, -0, -1, 0>, 6.0, <-0, -0, -1, 0>, 6.0], [KFM_DATA, KFM_ROTATION, KFM_MODE, KFM_LOOP]); // Spinning on Z once every 12 seconds!
}
}

Help would be very much appreciated. 

Link to comment
Share on other sites

Sample below has the empty events for you,

You just need to add the relevant code to do whatever needs to be done is response to those events being triggered.

default{	state_entry()	{		llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); // Required to use llSetKeyframedMotion! (restart script once)		llSetKeyframedMotion([<-0, -0, -1, 0>, 6.0, <-0, -0, -1, 0>, 6.0], [KFM_DATA, KFM_ROTATION, KFM_MODE, KFM_LOOP]); // Spinning on Z once every 12 seconds!	}	touch_start(integer total_number)	{		//		 do stuff required at start of touch here	}	touch_end(integer total_number)	{		//		 do stuff required at end of touch here			}	}
Link to comment
Share on other sites

She means something like this, I think.

integer StartStop;default {    state_entry() {        llSetLinkPrimitiveParamsFast(LINK_THIS, [PRIM_PHYSICS_SHAPE_TYPE, PRIM_PHYSICS_SHAPE_CONVEX]); // Required to use llSetKeyframedMotion! (restart script once)        llSetKeyframedMotion([<-0, -0, -1, 0>, 6.0, <-0, -0, -1, 0>, 6.0], [KFM_DATA, KFM_ROTATION, KFM_MODE, KFM_LOOP]); // Spinning on Z once every 12 seconds!    }    touch_start(integer num) {        if (StartStop = !StartStop) {            llSetKeyframedMotion([],[KFM_COMMAND, KFM_CMD_PAUSE]);        }        else {            llSetKeyframedMotion([],[KFM_COMMAND, KFM_CMD_PLAY]);        }    }}
Link to comment
Share on other sites

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