(Solved) Trying to call a behavior in onParticleCollision callback
by J.T. Ooley · in Torque Game Builder · 09/24/2010 (12:53 am) · 3 replies
I'm trying to have the splash from a particle effect damage enemies. With an echo statement, I know that when each particle collides with said enemies, a collision is detected. So my problem is calling the enemies "stats" behavior in the onParticleCollision() callback.
This code gives me an error in the console:
This code gives me an error in the console:
Quote:
game/gameScripts/SceneObjects.cs (45): Unable to find object: ' ' attempting to call function 'getBehavior'
function SplashClass::onParticleCollision( %eff , %dstObj , %srcRef , %dstRef , %time , %normal , %contactCount , %contacts )
{
%behavior = %dstObj.getBehavior("EnemyStatsBehavior");
%behavior.CurrentHitPoints -= 1;
}About the author
#3
09/25/2010 (10:29 pm)
Yea I saw that last night. I ended up changing the effect to make a perfect circle and adding a trigger that grows with the effect. It wasn't quite what I was looking for, but actualy ended up looking better with the games visual presentation.
J.T. Ooley
New Noise