Unity RTS Engine

  1. Home
  2. Unity RTS Engine
  3. Units
  4. Unit Movement

Unit Movement

The unit’s parent object must have the Unit Movement¬†component attached to it. This is the component that handles the unit’s movement.

  1. Can Move: Can this unit move when ordered by the player?
  2. Can Fly: When true, then this unit will be marked as a flying unit. Make sure that you have an air terrain set up correctly in the Terrain Manager and make sure that the Nav Mesh Agent component of this unit includes the air terrain area in its path finding area mask.
  3. Use Nav Agent: When enabled, moving the unit along its path will be handled by the Unity navmesh built-in Nav Mesh Agent component instead of this component. Please note that when the unit is created and this field is enabled, the values for the Speed, Acceleration and Angular Speed fields overwrite their correspondent fields in the Nav Mesh Agent component.
  4. Reset Pending Movement: Enable this field to reset unit’s movement (Make the unit stop moving) when it receives a new command while movement is already active (Basically enable this to make the unit stop moving and then start movement again with 0 acceleration or disable this field to transition to the new movement smoothly by keeping same current acceleration and speed to start the new movement with).
  5. Speed: The unit’s movement speed.
  6. Acceleration: How fast does the unit get to its speed when it starts moving?
  7. Min Corner Distance (When ‘Use Nav Agent’ is disabled): When building the movement’s path, sometimes the built-in navmesh solution will produce some corners in the path that are too close to each other. The value entered in this field determines how far should each corner of the movement path should be from the next one.
  8. Target Position Collider: A Collider Component that is attached to an empty object, child of the main unit object. The Collider must have “Is Trigger” enabled and its size must approximate the area that the unit occupies on the navigation mesh. This collider is defined to organize group movement between units.
  9. Can Move Rotate: Can the unit rotate when it’s moving towards its target destination?
  10. Minimum Move Angle: Only when rotation on movement is disabled, you may input the minimum angle that the unit has to face (rotate to) before moving towards its next destination in the movement path.
  11. Can Idle Rotate: Can the unit rotate when it’s idle to face its destination position/target object?
  12. Idle Angular Speed: In case the above field field is enabled, how fast does the rotation updates when the unit is not moving?
  13. Movement Angular Speed: How fast does the unit rotate while moving? In case Use Nav Agent field is enabled then this value will overwrite the “Angular Speed” field of the unit’s NavMeshAgent component.
  14. Movement Order Audio: Audio clip played when the unit is ordered to move.
  15. Movement Audio: Audio clip played (on loop) when the unit is moving.
  16. Invalid Movement Path Audio: Audio clip played when the movement path is invalid.
  17. Task UI: Allows to display a dedicated task to move the unit in the task panel when it’s selected.
    1. Enabled: Only when this field is checked will the task be displayed.
    2. Icon: The task’s icon that will be displayed.
    3. Panel Category: In which task panel UI category will the task appear. For more information about UI task panel categories, check out the UI Manager.

How can we help?