Friday 25 October 2013

Unit Rally Point for Buildings

  • The rallypoint is represented by a flag but could be replaced by any mesh or particle system.
  • It works by enabling or disabling the mesh renderer for the object, enabled only when the building is selected and belongs to the human player.
  • The user can then click the rally button in the HUD and select any area on the defined "Ground" plane to set the rally point. This is achieved by using raycast like that used by the unit selection.
  • When a unit is created it spawns at the spawnPoint of the building and moves to the rallyPoint with the same attributes(movement speed, rotates speed) as defined in the units attributes.


No comments:

Post a Comment