Jump to content

Help noob with seesaw script


crazyben0721
 Share

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

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

Recommended Posts

I need helping building a seesaw. I have done two script in the attemp to make this work. None of them work very well. I tried to use SL physics.

 

integer benSwitch = 1;

default
{
    state_entry()
    {
        llSay(0, "Hello, Avatar!");
        llSetStatus(STATUS_BLOCK_GRAB, TRUE);
    }

    touch_start(integer total_number)
    {
        if ( benSwitch == 1 )
        {
            llApplyRotationalImpulse(<0,0,20>,TRUE);
            benSwitch = 0;
        }
        else
        {
            llApplyRotationalImpulse(<0,0,-20>,TRUE);
            benSwitch = 1;
        }
    }
}

 I tried with llPassCollisions TRUE and FALSE and it was still not so good.

integer benSwitch = 1;


default
{
    state_entry()
    {
        llSay(0, "Hello, Avatar!");
        llSetStatus(STATUS_BLOCK_GRAB, TRUE);
        llPassCollisions( TRUE );

        
    }

    collision_end(integer num)
    {
        
        if ( benSwitch == 1 )
        {
            llApplyRotationalImpulse(<0,0,20>,TRUE);
        }
        else
        {
            llApplyRotationalImpulse(<0,0,-20>,TRUE);
        }        
        
        
    }
    
    collision_start(integer num)
    {
        if (benSwitch == 1)
        { benSwitch = 0; }
        else
        { benSwitch = 1; }
    }
    
}

 

Thank You in Advance

Benjamin Betancourt

 

http://i10.photobucket.com/albums/a147/crazyben21/seesawSL.jpg

Link to comment
Share on other sites


crazyben0721 wrote:

I have one question though. Should I avoid physics for now because I Just starting scripting in LSL.

 

I tend to come up with up with ideas that tend up to be complicated.
Also I get stuck with complicated things because I like solving it.

then I'd say no, don't avoid it... just realize that physics within SL are very limited... few effective products make use of it, but plenty of interesting personal projects.

Link to comment
Share on other sites

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