Search Unity

Is there a way to extend the MoveTowards path?

Discussion in '2D' started by captnhanky, Mar 9, 2019.

  1. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Hi!

    I am experimenting with MoveTowards for an enemy bullet to hit the player.
    When the bullet misses the player it stops in the air.
    The bullet should go right through the target position to outside of the playfield.

    Is there a way to extend the path of MoveTowards?

    Thanks
    Andy
     
  2. uweenukr

    uweenukr

    Joined:
    Jan 17, 2011
    Posts:
    54
    Move towards is probably not the best solution for this problem for the reason you have found. Try using something with velocity maybe?
     
  3. captnhanky

    captnhanky

    Joined:
    Dec 31, 2015
    Posts:
    97
    Yes thanks, I use AddForce now and it works better...I just wanted to know if it is possible in principle