Right now I’m trying to make a small game that’s like Simon, and just click some squares that light up and you click them to score points . This is a game with a top down perspective .
I tried creating a game object that shot projectiles at the squares , but all the scripts ive tried thus far won’t shoot where I click . Instead it sways to the side a bit . This is my first game with unity, any help will be appreciated
Then in an input script (assigned to say some object in the scene, like an empty gameobject you might name “Input Controller” or something), you want to check for mouse button down in the the Update. Input.GetMouseButtonDown(0) will do the trick.
When that happens, get yourself a Ray to cast into the scene. You can get one based on where the user clicked the mouse (or touched the screen) with a convenient method on your Camera ScreenPointToRay(). Pass in the mouse coordinates (see Input).
Then use that ray in a Physics.RayCast() call to see what, if anything in the scene it hit.
Search the docs for any of the above methods for more info.
Your game sounds similar to a tutorial walkerBoys has done. You might want to check it out. Go to part 26 of the series to see what the finished game looks like.