I need a little help on a problem i have. i want to place an object in 2d space at my mouse position, so i used ScreenToWorldPoint. but it comes up as an error
mousePos = Input.mousePosition; //this is already defined at the start
Vector3 placement = new Vector3 (Camera.main.ScreenToWorldPoint(mousePos));
for(int i = 0; i < towers.Count; i ++)
{
if(towers*.selected == true && Input.GetButtonDown ("Place"))*
-
{*
_ towers*.selected = false;_
_ GameObject clone = Instantiate(towers.towerObject, placement, Quaternion.identity) as GameObject;
}
}
it says
(33,92): error CS1729: The type UnityEngine.Vector3' does not contain a constructor that takes
1’ arguments*
and
Object reference not set to an instance of an object_