Jump to content
You are about to reply to a thread that has been inactive for 1528 days.

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

Recommended Posts

Posted (edited)

Here's an example of an avatar bumper sound script. Is there a way for it to only detect horizontal collisions such that if you tp on someone's head, it doesn't play. This is for people with tp sounds because one sound will interrupt the other.

float volume = 1.0; //Volume 0.0 - 1.0;
default
{
    collision_start(integer num)
    {
        if(llDetectedType(0) & AGENT)
        {
            llStartAnimation("lulz");
            llPlaySound(llGetInventoryName(INVENTORY_SOUND,llFloor(llFrand(llGetInventoryNumber(INVENTORY_SOUND)))),1.0);
            llSetTimerEvent(1.0);
        }
    }
    timer()
    {
        llStopAnimation("lulz");
    }
    attach(key uid)
    {
        if(llGetAttached())
            llRequestPermissions(llGetOwner(),PERMISSION_TRIGGER_ANIMATION);
    }
}

 

Edited by Leo1452
Posted (edited)

I'm not sure if this is for a car bumper (I think they call them fenders over the other side of the pond) but the obvious way is to get the position of the colliding object via llDetectedPos(0), and compare the z component with that of llGetPos(), the absolute value of the difference in heights is then used with a tolerance to determine if the two are level or not.

Edited by Profaitchikenz Haiku
llGetPos(0) was wr--- wr--- not quite right
  • Like 2
Posted

The only thing I can really think of is using llDetectedVel(0) in the collision event to get the colliding agent's velocity (vector) and then checking whether the X and/or Y are unequal to zero or higher than some arbitrary minimum value you set after lots of experimentation.

You are about to reply to a thread that has been inactive for 1528 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
×
×
  • Create New...