AI onCollision?
by Trevor Dahlke · in Torque Game Engine · 05/03/2007 (5:02 am) · 2 replies
Can anyone point me in the right direction here? I have a little ai guy running around and i want an effect to happen when he collides with the player. Any help would be appreciated.
Torque Owner Caleb
Default Studio Name
function YourAIDataBlockName::onCollision(%this, %obj, %col) { if (%col.getClassName() $= "Player") { //Do your affect here } }There is a weird problem I have seen with collision. If I'm being chased and I'm running away, if I change direction and run toward him, I can run right through him. I hope this doesn't effect your onCollision stuff.