Change camera origin point to top left?

is it possible to to change the camera’s origin point(the cameras 0,0 position)
to the top left corner of the camera itself?

right now it look like the camera’s origin(0,0) is the center

Sorry! Yes it was a bit quick and those are just compiler errors, I'll update it in a sec

I updated it again for you to include exactly what you need in your update function. I also edited your timer, it's faster to do it this way

It is because nextFire was never declared, a pretty easy mistake to catch. I fixed it, but you really ought to learn how to discern errors yourself! It's an invaluable coding skill. Pay attention to what happens when you try to load the script in Unity, the error code will tell you how to fix it usually.

It's alright. I was new and bad at this myself once! If this isn't working out, why don't you just send me a copy of your game so far at oStaiko45@gmail.com and I'll see what's causing it for you

2 Answers

2

Yes and no. I’m having a hard time answering since the approach here seems a bit off.

The short answer is: move your camera down in the negative y-direction and to the right along the z-axis. If the camera is orthographic, the amount to move should be

var aspectRatio = (float)Screen.width / Screen.height
new Vector3(camera.orthographicSize * aspectRatio, -camera.orthographicSize) 

The longer answer is:
In Unity you never position objects in “a camera view’s coordinate system”, so a camera doesn’t really have an origin point.

All you have is the object’s world position and the camera’s view frustum. Those are the only factors determining where on the screen an object is drawn.

Yes you can move your camera transform in such a way that the world (0,0,0) is in the top left corner. If you use an orthographic camera, it’s easier, with perspective camera it’s trickier and the distance from camera becomes a factor too.

Actually since it’s 3D there’s always a whole line segment in world coordinates on which objects appear in the top left corner. What that line segment is depends on the camera’s settings, orientation and position.

Alright ill have to test it in the morning. Thanks! (i hope this works)

Well when i put it in the void update i had (i did not replace what i had) it just made it not shoot at all :c

I tried you code an it has a ton of syntax errors.
please post valid code as an example as it won’t help new users otherwise.