MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / followObject

Method followObject

Engine/source/T3D/aiPlayer.cpp:902–917  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

900}
901
902void AIPlayer::followObject(SceneObject *obj, F32 radius)
903{
904 if(!isServerObject())
905 return;
906
907 if ((mFollowData.lastPos - obj->getPosition()).len()<mMoveTolerance)
908 return;
909
910 if(setPathDestination(obj->getPosition()))
911 {
912 clearCover();
913 mFollowData.object = obj;
914 mFollowData.radius = radius;
915 mFollowData.lastPos = obj->getPosition();
916 }
917}
918
919DefineEngineMethod(AIPlayer, followObject, void, (SimObjectId obj, F32 radius),,
920 "@brief Tell the AIPlayer to follow another object.\n\n"

Callers 1

aiPlayer.cppFile · 0.80

Calls 2

lenMethod · 0.45
getPositionMethod · 0.45

Tested by

no test coverage detected