Search Unity

What should I use for my enemy movement?

Discussion in 'Physics' started by appllowastaken, Feb 3, 2019.

  1. appllowastaken

    appllowastaken

    Joined:
    Jan 28, 2019
    Posts:
    5
    I'm making a tower defense game where enemies have to move along a path with waypoints to the end. I have everything set up perfectly, but I am currently using rigidbody.velocity for the movement. Since I have towers that slow down the enemies, I need to update the velocity of the rigidbody every frame. The docs say not to do that.
    Then, I found that there is a rigidbody.MovePosition(). But, I will have black hole towers in the future that will suck enemies into a black hole. I would use rigidbody.AddForce() for that. I am not sure that AddForce() will work when I am calling MovePosition() every frame :/. What should I use then?