Game Development Community

My AIPlayer spins around

by Snaggz · in Torque Game Engine · 08/27/2006 (12:52 am) · 2 replies

I have an AIPlayer that is an ant. When i use the setAimObject() to anything he just sits there and starts spinning around. I didnt always have this problem. Also, when i change the shapefile to my dwarf he looks where hes supposed to without spinning.

#1
08/27/2006 (11:40 am)
Probably the problem is in your "eye node" animation. Torque use eye node for calculate the distance until the final position. Take a look in to the AIPlayer.cc file, int the function getAIMove the engine calculate the movement and rotation to the final position.

Try to insert

mAimLocationSet = false;

after

// Check if we should mMove, or if we are 'close enough'
if (mFabs(xDiff) < mMoveTolerance && mFabs(yDiff) < mMoveTolerance) {
mMoveState = ModeStop;

Hope this help you and sorry for my bad english :p.
#2
08/28/2006 (2:28 am)
Yeah i just added an eye joint for my ant now he dosent spin. thanks for the help