   How to make an enemy agent circle around a character?
  I would like to make an enemy agent move in a circular motion around the player character.  How the agent behaves would be like this. It picks a point which is 60 degrees away from the front facing vector of the character.  Then it moves to that point in a circular motion.How do I make the agent move a circle from its initial position to the destination around the character?Also, to find the vector which is 60 degrees away from the front facing vector, is multiplying the x,y,z components of the front facing vector by cos 60 the correct way to do so?:s   
  i think that's as simple as first translating your enemy character and then rotating the enemy agent.if i remember right the translation xyz will be around which point your enemy will rotate and the rotation x\y\z will be how far the enemy is from the point. ;  Treat the player as the origin, and calculate locations in polar. Then move to those locations. For example:r = 10 # distance from player to aim fortheta = pi / 3 # that is, 60 degreestargetX = playerX + r * cos(theta)targetY = playerY + r * sin(theta)To circle, simply increment theta and keep running this loop.   ;  I tried using the sine and cosine method as shown above but the enemy agent did not move in a circular pattern around the character.It moved in a straight line about 30 degrees away from the front facing vector of the character and then it just spun about in circles continuously from a distance away from the character.I did it in python script as shown below:theta = DegToRad(self.m_startAngle)dest.x = target.GetTranslation().x + radius * math.cos(theta)dest.y = target.GetTranslation().y + radius * math.sin(theta)dest.z = target.GetTranslation().zif self.m_startAngle = 120:   self.m_startAngle = 120else:   self.m_startAngle += 1 dest refers to the destination point while target refers to the character. self.m_startAngle is initialized to 0. The above code snippet is executed for every frame update.What did I do wrong? :(   ;  Is this really what you want?if self.m_startAngle = 120:   self.m_startAngle = 120else:   self.m_startAngle += 1Why only 120 degrees? Do you mean to reset m_startAngle to 0?How do you use dest?[Edited by - wild_pointer on April 15, 2009 3:35:09 PM];  Ahh yes, the agent can move in a circle now.Whenever the angle reached 360 or 0 degrees, I switched the variable flag to either decrement or increment the angle.Thanks all for the help! :)   ;  Hi i am also interested how this is done.Weng can u post the full code and how r u using destX destY, destZ etc.. are u passing these to ur move method for the entity.What i am trying to achieve is to get the enemy to come close to the player and then at a certain radius start going around the player, is this what your code does :)   ;  Will there be terrain in your game world that might block attacks or visibility?  That will complicate things, and will impact the approach you should take.   ;  my game will be a 2d scrolling beat em up with a z plane like final fight   ;  Hi lodoss, shown below is the code snippet which rotates the enemy character around the player. It is written in Python:self.m_Rotate = True r = 30 # distance from player to aim for if self.m_Rotate == True:    theta = Orion.MathHelpers.DegToRad(self.m_currentAngle)    playerPos = self.m_enemyManager.GetEnemy().GetTranslation()    playerPos.x = playerPos.x + r * math.cos(theta)    playerPos.y = playerPos.y + r * math.sin(theta)self.RunToTarget(playerPos)  if self.m_currentAngle >= 360:    self.m_Increment = Falseif self.m_currentAngle <= 0:    self.m_Increment = Trueif self.m_Increment == True:    self.m_currentAngle += 1.8    else:    self.m_currentAngle -= 1.8 Hope it helps~   