Game Development Community

Problem with Collision

by Brandon Fogerty · in Torque Game Engine · 06/06/2007 (10:34 pm) · 0 replies

Hi. I just bought the torque game engine and tried making the first mission.

Everything is fine except for thr torque scripting tutorial that comes with the engine.

I want the Torque logo to disappear when the player touches it. So in my logoitem.cs file, I wrote the following,

datablock StaticShapeData(TorqueLogoItem)
{
category = "Items";
shapeFile = "~/data/shapes/3dtorquelogo/torque_logo.dts";
};

function TorqueLogoItem::onCollision(%this, %obj, %col)
{
if(%col.getClassName() $= "Player")
{
%obj.delete();
}
}

And it compiles fine. However when I touch the logo, it doesn't go away. What is up?