Jump to content

Help with trigger splash particle script when floating


Coby Allen
 Share

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

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

Recommended Posts

I have a request for some help with scripts. I am trying to make my own bow splash for sailboats and i am struggling to make the script being triggered when the object moves / floats at a certain speed and ends when going below that speed. Could someone help me with that? 

Kind Regards 

Link to comment
Share on other sites

4 hours ago, Kyrah Abattoir said:

have a look at llGetVel()

and llVecMag() to turn the vector into an absolute speed, or just square the velocity if you're comfortable working with quadrances.

float min_speed = 25.0; // 5 meters per second.
float prev_speed;
stop_particles(){}
start_particles(){}
default
{  state_entry()
   {   llSetTimerEvent(0.2);
   }
   timer()
   {   vector vel = llGetVelocity();
       float v = vel*vel;
       if(v<min_speed)
       {   stop_particles(); // stopping particles that are off shouldn't cause any bad effects.
       }else if(speed_prev<min_speed) // but re-starting particles that are already on might.
       {   start_particles();
       }
       prev_speed = v;
   }
}

 

  • Like 1
Link to comment
Share on other sites

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