Aller au contenu

Photo

Vectors and position help needed


  • Veuillez vous connecter pour répondre
2 réponses à ce sujet

#1
Shadooow

Shadooow
  • Members
  • 4 470 messages

I have two objects and I need to make one to run towards the position of the second object +1meter more.

 

I cant figure this out and yes I read the vectors tutorial make me even more confused.

 

Anyone?



#2
WhiZard

WhiZard
  • Members
  • 1 204 messages

object o1; //Define Object to Move
object o2; //Define Target Object to Move Past
vector vDis = GetPosition(o2) - GetPosition(o1);
vDis *= (VectorMagnitude(vDis) + 1.0)/ VectorMagnitude(vDis);
AssignCommand(o1, ActionMoveToLocation(Location(GetArea(o1), GetPosition(o1) + vDis, VectorToAngle(vDis))));



#3
Shadooow

Shadooow
  • Members
  • 4 470 messages

thanks thats it :)