Jump to content



Recommended Posts

Hi guys.

I tried to have move the NPC:
I create the NPC(No problem with creating):

//In end of Function 'OnGameStarted'
SecondPlayer = theGame.CreateEntity((CEntityTemplate)LoadResource('cirilla'), randomPos, thePlayer.GetWorldRotation());		

And add the following AI:

//In function 'OnTick', check game load is finished
var l_actor 			: CActor;
var l_aiTree			: CAIMoveToPoint;
l_actor = ((CActor)SecondPlayer);
l_aiTree = new CAIMoveToPoint in l_actor;
l_aiTree.enterExplorationOnStart 		= false;
l_aiTree.params.moveSpeed 				= 1.f;
l_aiTree.params.destinationHeading 		= VecHeading(thePlayer.GetHeadingVector());
l_aiTree.params.destinationPosition 	= thePlayer.GetWorldPosition();
l_aiTree.params.maxIterationsNumber 	= 1;
l_aiTree.params.moveType = MT_Sprint;
l_actor.ForceAIBehavior( l_aiTree, 0);

but this has no results, my npc is still a stay on the place.

I dont want a 'Following', i want a move to custom position


What is problem?

P.S. Steam License, Last Version, All DLC

Edited by psih1337
Link to comment
Share on other sites

  • 3 years later...
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...