Enemy moves to certain point ?

Updated on December 21, 2016 in Answers
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on December 21, 2016

My enemy should moves to ceretain point in the scene. this point moves around all what he has to do is follow it.


wak = new Vector3(spot.transform.position.x,spot.transform.position.y + 3,spot.transform.position.z);

transform.Translate(Vector3.forward(wak) * 2 * Time.deltaTime); // enemy to follow the point

  • Liked by
Reply
1 on December 21, 2016

What’s not working? You aren’t giving any information you’re just saying it should do something but we don’t know if it does or doesn’t, where the problem is. Please provide more information

on December 21, 2016

enemy object moves direct to spot object position. But i need it above it. so i make a point (wak) above spot object. so, enemy will follow spot object and will stay above him at wak position. here is my script:

 public Transform spot;
public Transform enemy;
public float move_speed;
 public Vector3 wak;
 // Update is called once per frame
 void Update () {
wak = new Vector3(spot.transform.position.x,spot.transform.position.y + 3,spot.transform.position.z);
// enemy = !!
}

Show more replies
  • Liked by
Reply
Cancel