Answer the question
In order to leave comments, you need to log in
How to implement shooting if the camera is not moving?
the game is from a 3rd person, the camera is not movable and not centered, and it turns out that when I aim at an object in the viewport of the game, the sight is on the desired object, but in fact it only seems so because of the location of the camera, but when I throw a beam - it passes by, since the sight is not actually directed at the object, can I somehow solve this, or just put the camera in the center of the screen?
I want to aim like this at 3:30 https://www.youtube.com/watch?v=-u5VnyjLq0c&t=356s
Answer the question
In order to leave comments, you need to log in
Vector3 viewportPoint= Camera.main.WorldToViewportPoint(crosshair.position);
Ray viewportRay = Camera.main.ViewportPointToRay(viewportPoint);
An orthogonal camera that projects 3D onto the screen of the monitor plane ... It seems that it is needed.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question