Author Topic: onCollision for a projectile?  (Read 818 times)

What is the code for onCollision on a weapons projectile? Isnt it something like this:

projectilename:onCollision(%obj,%play)
{
Stuff that happens on impact here
}

Although I don't remember the variables, it definitely needs "Function" before it, like this:

Code: [Select]
function projectilename:onCollision(%this,%play) {
   Stuff that happens on impact here
}

Somewhere in there is the real %obj, which is what it collides with.
« Last Edit: June 14, 2010, 09:44:01 PM by MegaScientifical »

If you're talking about colliding with a player, use ProjectileData::damage, there's a sticky about it.

Code: [Select]
function projectileName::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
    //code here
}

Code: [Select]
function projectileName::onCollision(%this,%obj,%col,%fade,%pos,%normal)
{
    //code here
}

i was ninjs'd. >:C