So, I made a script where something should be instantiated where the mouse is positioned.
However if (Physics.Raycast(ray)) {} never gets called.
I can’t seem to figure out why…
Here’s my current code : (this is nto the full code, but I think this is the only part needed, if not tell me. )
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
if (Physics.Raycast(ray))
{
if (Input.GetButtonDown("Fire1"))
{
Instantiate(towers*, Input.mousePosition, transform.rotation);*
Debug.Log(“Instantiated”);
towerRayBools = false;
}
}