Game Development Community

Moutning

by Danny Mejia · in Torque Game Builder · 08/24/2006 (9:23 am) · 0 replies

I can get my object to mount but I don't want to do it my name. So I want to ball to move only if the X or Y position between the to point is = 15 and they are the same pad types. I can't get the dynamic field to wrok right. I have try it like this. p1.padtype

Here is what I have

function gear::onMouseDown(%this, %modifier, %worldPosition, %mouseClicks)
{
/////////////////////////////////////
My rotation code of my other object is here
/////////////////////////////////////////////////////
if(t2dVectorDistance(p0.getPositionY(),p1.getPositionY())=15)
{
if(p0.padtype || p1.padtype = "red)
{
ball1.dismount();
ball1.mount(p1,0,0,0,false,false,false,true);
}
}
}


I have 10 pads one screen. The class name is Pad the the pad name are p0-p9.

I want the move to dismount and move to the other pad next to it or below it if the pad is the same type.

I have need a Dynamic field name padTyep.