Here is the screen shot of the script with desired effect:
default
{
state_entry()
{
}
collision_start(integer num_detected)
{
// Finds the name of the object that collides
llOwnerSay("Collided with " + llDetectedName(0));
//Finds the velocity in a vector and converts to its magnitude
vector velocity = llDetectedVel(0);
float normVelocity = llVecMag(velocity);
string objectOwner = llKey2Name((string)llDetectedOwner(0));
llOwnerSay(objectOwner + " travelling at " + (string)normVelocity + " m/s");
}
}
{
state_entry()
{
}
collision_start(integer num_detected)
{
// Finds the name of the object that collides
llOwnerSay("Collided with " + llDetectedName(0));
//Finds the velocity in a vector and converts to its magnitude
vector velocity = llDetectedVel(0);
float normVelocity = llVecMag(velocity);
string objectOwner = llKey2Name((string)llDetectedOwner(0));
llOwnerSay(objectOwner + " travelling at " + (string)normVelocity + " m/s");
}
}
No comments:
Post a Comment