Help with RTS style controlls.

Hi, I am creating a RTS similar to the style of Age of Empires. Before I begin I was just wondering about a few things. The concept of right clicking a unit, then left clicking to add a destination for them to move towards. Now I am understanding the fact of obstacles. How hard would it be to write a script that makes them find a different route or a correct route to avoid obstacles such as buildings, trees, walls, etc.

NNext the whole clicking on the unit, then there ability section of the UI will show the structures they ccan create. If you select let’s say a farm, whenever the mouse is over the users game screen it will show a drag-able farm pprefab. Once they right click it cancles the aactionn and deletes the prefab. But if the left click it places the prefab on
the ggground.

SSorry about the double letters in my text. I am typing this off my phone and its messing up. Any information will be useful. Thanks for your time.

This question should really be broken up into two questions. Still, for the first part you will want to look into Unity pathfinding: http://unity3d.com/unity/quality/ai

To your second point,you may want to check out the OnMouseDown method. However, I’m not sure exactly what you are asking: Unity - Scripting API: MonoBehaviour.OnMouseDown()