'Pursue' is a behavior where an AICharacter moves in the direction of a target NodePath until it reaches that entity, performing a change in direction of motion according to the entity's motion.
priority is by default set to 1.0 and is used when using two or more steering behaviors on an AICharacter.
The velocity at which the AICharacter pursues is determined when you first create your AICharacter object using the AICharacter constructor.
Note : Pursue's direction is recalculated every frame to handle any change in the target's position.
The actual code working in Panda3D :
#for directx window and functions import direct.directbase.DirectStart #for most bus3d stuff from pandac.PandaModulesimport* #for directx object support from direct.showbase.DirectObjectimport DirectObject #for tasks from direct.taskimport Task #for Actors from direct.actor.Actorimport Actor #for Pandai from panda3d.aiimport* #for Onscreen GUI from direct.gui.OnscreenTextimport OnscreenText
# Globals speed = 0.75
# Function to put instructions on the screen. font = loader.loadFont("cmss12") def addInstructions(pos, msg): return OnscreenText(text=msg, style=1, fg=(1,1,1,1), font = font, pos=(-1.3, pos), align=TextNode.ALeft, scale = .05)