Hi, i’m VERY new to Unity. Like i started just now.
So i’m trying to make a turret of a tank rotate towards a point in the world. This point is defined by my mouse cursor on the screen which is then converted to a world point.
I’m working in a 3D space, even though it’s a 2D game i’m making. The reason for that is because it’s a school project and there has to be an ability to to toggle between perspective and orthographic mode. Even though perspective mode would obviously render my screen to world mouse position useless, i still want to try and get this to work for “reasons”.
So what i did was look up some info regarding this technique and what i found was a post by someone that pretty much came down to the following piece of code.
Vector3 _target = Camera.main.ScreenToWorldPoint(Vector3(0,0,0));
Now when i go into Unity it gives me a compile error.
“Expression donates a ‘type’, where a ‘variable’, 'value or ‘method’ was expected.”
Now as i said, this is probably an extremely newbie question. But keep in mind i’m very new to programming in general. I do have a tiny bit of c++ programming behind me, but that’s about it.