Search Unity

  1. Unity 2020.1 has been released.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

RTS Style movement without rigidbody?

Discussion in 'Physics' started by uberalles, Sep 21, 2015.

  1. uberalles

    uberalles

    Joined:
    Jun 29, 2013
    Posts:
    46
    I have human characters moving around with standard RTS left/right clicks. I have a navmesh agent on the object as well as a capsule collider. Movement/rotation is handled through scripts between the navmesh and animator controller. I originally had a rigidbody on the object as well but have since removed it and have noticed no difference in movement. If the navmesh and scripts are handling all movement do I really need a rigidbody?
    Also, I've been trying to get the character to take a slight step up moving off of a street an onto a sidewalk but can't seem to get it to work (without a script making the character move up). Big thanks for any advice/help anyone can offer.

    *Update, I realize that I need a rigidbody to collide with other objects but my character continue to walk through the sidewalk or simply walks into it and continues walking without moving (depending on the settings).
     
  2. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    4,945
    If the sidewalk has a navmesh (is navigation static), it should make whatever's walking on it move up.

    Also, yes, you don't need rigidbodies if you're moving with NavMeshAgents. If you need hit detection, you can use trigger hitboxes.
     
unityunity