Questions tagged [camera]
Game worlds are viewed from a camera, which is the viewpoint from which the game world is observed from.
1,222 questions
0
votes
0
answers
121
views
Why does this code behave strangely with different camera angles?
Relevant to this issue are two MonoBehaviour scripts: Actor and Player. ...
0
votes
2
answers
121
views
Camera Snapping instead of panning
I am trying to make a camera system for a 2D platformer, with three camera modes to begin with:
Follow, normally following the player
Horizontal: Y is set, X follows player
Static: Locked to a certain ...
0
votes
1
answer
161
views
Is the "View transform" just a change of basis matrix + a translation applied to each point? (to bring them into camera space)
I am learning about the graphics pipeline. My understanding of the view transformation is that you:
First create a normalized, separate coordinate system for the camera, based on its position and ...
1
vote
1
answer
681
views
Why don't more top-down 3D games use an oblique projection, instead of tilting their models and sprites?
I'm making a 2D game in Unity that is set-up in 3D similarly to Enter the Gungeon, where I have an orthographic camera rotated 45 degrees. This makes sprites look wrong and I've seen two main ways to ...
0
votes
1
answer
76
views
Computing camera attitude so points along/follows spline
Assuming I have a spline that I want a camera to follow, is there a simple way to compute the orientation of the camera such that its optical center aligns with the vector defining the derivative of ...
0
votes
0
answers
129
views
Camera Shake Issue in UE5
I'm experiencing unexpected camera behavior while implementing a camera shake effect in my first-person project. After adding the camera shake, the camera is not behaving correctly (the camera is not ...
0
votes
2
answers
96
views
Position camera to 'head' joint's position in skeletal animation
Finished this great tutorial on skeletal animation:
https://learnopengl.com/Guest-Articles/2020/Skeletal-Animation
All works as expected, no issues!
Here is what matrixes I use to achieve skeletal ...
0
votes
0
answers
56
views
Unknown light source in viewport when camera projection is orthogonal
I'm using Godot/Redot for my game development but so far this happens when camera projection is orthogonal, there's unknown light following the viewport when the camera is moving.
Here's the example
...
2
votes
1
answer
179
views
How can I use multiple monitors in Unity?
I am trying to work with two monitors; I want to have two cameras in my scene, such that each camera projects to a different monitor. I tried to follow this guide, which says that I have to change the ...
0
votes
0
answers
39
views
Adjusting Minimap Camera Viewport Indicator to Account for Occlusion of Camera by UI
I am working on a 2D RTS game in Unity. One thing I want to represent is a minimap indicator that shows the camera's viewport. I got it working, but it doesn't reflect how the camera is occluded by ...
0
votes
1
answer
307
views
How to blend camera when switching between 2 characters?
I'm trying to set up a system in UE4.27 where I can switch between 2 characters. It works but when I tried to include a camera blend, it still switches character but the camera just jumps and doesn't ...
0
votes
1
answer
85
views
Coins Not Moving to Canvas Position When Camera Moves
I am currently developing a 2D game in Unity, and I'm having an issue with moving coins to a specific position in the UI Canvas when they are spawned. I want the coins to animate from their spawn ...
1
vote
3
answers
345
views
How to implement a 2D toroidal map?
I want to implement a toroidal world (all edges "wrap", the map repeats infinitely across its edges). My world is basically a 2D rectangle (it's a 2D game) divided into a grid.
The part I'm ...
0
votes
1
answer
92
views
Problem with 2D projection
I have a green circle:
Inside the circle, the white frame moves to wherever P, the projection of the targets 3D position into a 2D point, is.
However, outside the circle, the frame will move to the ...
0
votes
0
answers
89
views
Why distant objects are becoming white when camera is still?
I have a shader attached to quads that I'm generating far away using
script. The quad is capable of keeping the color when camera is moving
however the color becomes white when camera is still. I can'...
2
votes
1
answer
460
views
What is the concept of a "camera" in game development?
What is the concept of a "camera" in game development? It seems that OpenGL and Vulkan don't explicitly have a concept of a camera.
However, engines like Unity, Unreal Engine, Godot, Flutter ...
0
votes
1
answer
72
views
Differences between rotations and translations of different camera properties in LiBGDX
I am trying to understand the camera API (applicable to perspective camera ONLY) of LiBGDX.
It really does not make sense that you can call rotate and translate on many different properties of the ...
0
votes
1
answer
71
views
How can I use the velocity of a gameobject to calculate the camera position in Unity?
I am using AddForce() to make a ball move around the scene. The camera follows the ball at a fixed position. This is my camera script:
...
1
vote
0
answers
171
views
How to use screen space coordinate of the mouse to set a model position in game?
I'm trying to make a movement system in my game where you click the mouse and your model moves towards where you clicked on the landscape, my understanding is the normalized screen coords go from [-1,...
1
vote
2
answers
278
views
2D Zoom to mouse point
So I'm trying to create a zoom function for my 2D camera.
The best result I've got so far is:
But something still feels off, and I just can't seem to pinpoint it.
My code currently, which simply ...
0
votes
0
answers
135
views
Why do I have to freeze my player's x and z rotation to make my player movement work and why does my camera stutter when colliding with things?
So I have an empty object called player with the PlayerMovement script and a rigidbody. I have the main camera and player visual as childs of it. The movement works ...
1
vote
1
answer
115
views
how to to make a camera like scooby-doo game
I'm trying to make a camera like scooby-doo game.
Example: https://youtu.be/mkxm7-uw_uc?si=VpywD2wHJGAChw9N&t=238
It seems to be a 3rd person camera but its not always attached to the player. Its ...
1
vote
0
answers
117
views
How to calculate a direction vector from a 3x3 rotation matrix?
I have a dataset containing 2D images of telco towers and metadata. Each 2D image has 3x3 rotation matrix which provides orientation info about the drone when it captured the image.
Now I have a 3D ...
0
votes
1
answer
143
views
How can I make a camera follow an instantiated object at runtime?
I have an object meant to represent a player that I'd like to spawn in at runtime. Because it is instantiated at runtime, I'm not sure about how to get the main camera in my scene to follow the ...
1
vote
1
answer
75
views
how can I distance camera according to player speed?
How can I make the camera move further away from the player according to player's speed?
So, the camera is at default distance, but when the player catches a boost (increases speed), the camera ...
0
votes
3
answers
252
views
How to make camera follow player on Y+ axis only
My player is jumping on sticks, endlessly going upwards, and if they fall, it's game over.
I want the camera to follow the player only when they move up (ie. only on Y axis), not down. If they move ...
0
votes
1
answer
209
views
Camera rotation in TouchDesigner
I need help on something I'm struggling with very much.
I am working on a TouchDesigner patch where I have a Camera COMP with rotation on x, y and z axes. I need the formulas to convert such rotations ...
0
votes
1
answer
217
views
Lower Near Clipping Plane
I've searched everywhere and can't really find a good answer... Even with my near clipping plane set to 0.01 the objects are clipping too close.
Tried to get a view where you can see it clipping a ...
0
votes
1
answer
350
views
Mouse Ray Picking: Z-Coordinate of Projected vector (glm::unproject)
I've run into a curious issue when implementing ray picking in my game engine.
It seems the Z coordinate of the Projected matrix has to be ever so slightly more than ...
0
votes
2
answers
234
views
Why does everything I've made in Unity begin to vanish when I get close to it?
I've attempted looking into this via. the Unity Manual, and even posts on the Unity forum, although I've found nothing. I have already tried checking Occlusion Culling and general Object Culling.
I've ...
0
votes
1
answer
185
views
Cinemachine camera does not switch when brain is outside main camera
I have a Main Camera object set up like the screenshot below:
And another game object with Cinemachine Brain.
So, this way the main camera works but the timeline cinemachine tracks doesn't switch ...
2
votes
1
answer
758
views
Creating a new camera in 2D mode sets it as default, despite not being the main camera
I created a new camera in Unity's 2D mode, and for some reason it's being set as the main camera, despite not being tagged as such. The original main camera is in fact tagged as "main camera"...
0
votes
0
answers
86
views
The lighting result is wrong when switching scene in Unity
When I use SceneManager.LoadScene() to switch between scenes the result of lighting in loaded scene is wrong. However if I open the scene solely the lighting ...
0
votes
1
answer
128
views
Camera movement automatically tracking a tool over a surface
I need to create camera movement tracking the clipper hair like this:
I already have a script for the movement of the tool.
I'm using Snapping Player to the Surface of an Object of this pos How ...
1
vote
1
answer
255
views
How do real time cutscenes work?
I want to code a real time cutscene editor in my engine but I couldn't find any pdf documents or websites explaining it in detail. Is the cinematic scene file loaded with instructions like ...
0
votes
2
answers
146
views
Trouble setting camera position in Unity
I'm attempting to set the camera position in Unity through code. I have a simple 2D game and there's not much programming so far. I've attached a script to the camera, and in that script I've added ...
1
vote
0
answers
213
views
Good practices for making a manager class?
I found this post for designing a camera system the post mentions having a manager where you could register and set different cameras such as debug, player, script, etc and I kind of like this ...
0
votes
1
answer
67
views
Camera not following the player after spawn
After my character spawns, the camera just stays in the same place. How can I solve that?
Here's my code:
...
0
votes
1
answer
350
views
How to achieve camera zoom-In effect and locking view during NPC Interaction in Unity
I am currently working on an interactive game in Unity 3D where, upon pressing the "E" key, the player character interacts with an NPC. During this interaction, I aim to implement a camera ...
0
votes
1
answer
442
views
How to achieve smooth camera dragging with the mouse in SDL2?
I am working on a 2D isometric perspective game using SDL2 and I would like to implement the ability to pan the map when the right mouse button is held down.
I was wondering what is best way to set ...
1
vote
1
answer
132
views
Is it possible to add new waypoints to Dolly Track in Unity CinemachineVirtualCamera on the go?
I'm making a racing game "on rails" that utilizes generated map (similar to outrun). The map is made out of chunks that appear every time player crosses a Trigger area on the chunk that is 3 ...
0
votes
1
answer
172
views
Unity RB Controller Jitter on a Moving Platform
Brief Description: I have a RB based character controller that I want to move along with my Train platform (non physics based) when the player steps on it.
Main Problem
I manage to make the player ...
2
votes
1
answer
105
views
How do I add a function to the sequence of functions which runs pre camera culling in Godot?
In unity you can do:
Camera.onPreCull += OnPreCullCamera;
void OnPreCullCamera(Camera3D cam){
//...
}
But in Godot I don't know what the equivalent is. How do you ...
3
votes
0
answers
428
views
How to test for intersection of a cone with infinite camera frustum (no near/far plane)?
I have a given infinite camera frustum defined by four planes, each defined by a normal (left, right, bottom, top). From those planes we can also easily get the camera position and the view direction. ...
0
votes
0
answers
49
views
Follow camera is not turning when the followed object turns
I need a camera follow script to chase a moving ball. I've attached the script below to my camera, but when the ball turns left and right the camera does not turn
...
1
vote
1
answer
322
views
I want to convert world coordinates into camera coordinates
In world space, I have an axis (eg. [-1, 0, 0]) and a point (eg.[2,5,1]). I also have a 4x4 viewmatrix. Now I want to transform that axis and point in camera frame.
I am getting really confused. Does ...
0
votes
1
answer
889
views
Camera Calibration custom Model-View-Projection matrix in Unity?
Coming from this topic
I have a Model-View-Projection Matrix obtained from a Camera Calibration method, from where I want to render the scene:
...
0
votes
1
answer
531
views
Why doesn't RectTransform.GetWorldCorners() employ any camera?
Typically, conversion methods from world to screen coordinates and vice versa use a camera to perform these calculations, so I'm wondering how does GetWorldCorners ...
1
vote
0
answers
90
views
How to know when should a webcam/phone camera refocus?
This is the code I use to display the camera's footage inside my app:
...
0
votes
0
answers
37
views
How to set up Unreal camera dimensions to export a book cover?
In the following image, you can see the camera settings of Unreal Engine.
Suppose you have a scene. How can I setup the camera dimensions to match perfectly, and ready to export, an Amazon ebook ...