Jump to content
  • 0

script -- wheel of fortune spinning away


Syaoran Nyoki
 Share

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

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

Question

I'm trying to make a game show wheel of fortune type deal. It works the way I want in every way except occasionally it rolls away. I understand why it behaves in this way, but I am powerless to fix it. I really want it to be anchored somehow but still spin the same way. My wheel is a cylinder stood up like a car tire. Here is my script:

 

default
{
    state_entry()
   {
             llSetClickAction(CLICK_ACTION_TOUCH);
             llSetStatus(STATUS_PHYSICS, TRUE); //Enable physics
             llGroundRepel(5.0, FALSE, 0.1); // Make the object hover above the ground

  }

    touch_start(integer total_number)
    {
            //Loop for slowing down the rotation to a halt
           llSay(0, "Spinning The Wheel.");

            integer i;
            for(i=4;i>=0;i--)
            {
                 llTargetOmega(<0,0,30>, i*0.1*PI, 1);
                 llSleep(1.5);
            }
       }
}

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

That's because you made your wheel physical.  There's no need for that.  There are a few other problems with that script too.  For example, it will only spin the wheel properly if you have it set up in precisely the right orientation in world.  Try this instead...

integer gCount;default{    touch_start(integer total_number)    {        llSay(0, "Spinning The Wheel.");        gCount = 4;        llTargetOmega(<0.0,0.0,30.0>*llGetRot(), gCount*0.05*PI, 1);        llSetTimerEvent(2.0);    }        timer()    {        llTargetOmega(<0.0,0.0,30.0>*llGetRot(), --gCount*0.05*PI, 1);        if(!gCount)        {            llSetTimerEvent(0.0);        }    }}

 

  • Like 1
Link to comment
Share on other sites

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