Questions tagged [camera]

Game worlds are viewed from a camera, which is the viewpoint from which the game world is observed from.

Filter by
Sorted by
Tagged with
1
vote
0answers
6 views

Unity LWPL alternatives for camera stacking

I am working on upgrading a project in unity from a 2018 version to the latest 2019. One of the mechanics of the game is an AR(augmented reality) system. Some of the UI elements appear in the 3d world,...
1
vote
1answer
22 views

Is there a way to change displays in unity

I was wondering if I could change displays in Unity by hitting a key. For example, I want to look down on the battle, so I hit 1. Then I want to see it from the side. I hit 2, etc. Is that ...
0
votes
1answer
28 views

Unity 2019 depth-only camera now overwrites everything

We have a pretty traditional camera stacking set up: UI camera on top of a everything-else camera. The UI camera is set to only clear depth, and only draws the UI layer. The everything-else camera ...
0
votes
2answers
39 views

How can I calculate all the tiles visible to a camera in 2D?

I am creating a basic tile-based 2D game ~mostly from scratch in Java, however all I need is pseudo-code for how this could be achieved.  My problem lies in the fact that my world (stored in ...
0
votes
2answers
34 views

How to limit camera pitch (x rotation) between two angles

I use this script rotate the camera on its local X axis: float v = verticalSpeed * Input.GetAxis("Mouse Y"); transform.Rotate(-v, 0, 0); Right now this lets ...
0
votes
0answers
18 views

Unity Model causes screen to go black

So ive been having this problem for a while and i have no idea whats causing it or how to fix it. Some objects in my scene causes my camera when looked at to turn black as you can see from the gif i ...
0
votes
0answers
17 views

Make camera crop scene instead of scale/stretch it

I am trying to find a way to stop unity from scaling/stretching my pixel art game as I resize my window. What I want it to do instead is just crop the scene and not change the scale of my pixels so ...
0
votes
0answers
11 views

Extending the camera vs CameraHelper class vs camera field

I am following an eBook called "Learning Libgdx Game Development" In it, the author implements a CameraHelper class that implements ...
0
votes
1answer
19 views

Can't correct perspective of Main Camera in Unity 3D without losing field of view

I have been trying to create a space based rails shooter game following a particular online course and I find a tilt(roll) on my spaceship as I move it towards the left and right ends of the screen. ...
2
votes
1answer
110 views

How to preserve Arcball rotation in c++ OpenGL?

Firts of all want to say that I've already searched for other people's answers here as same as Google and didn't found anything about it there. Also tried some others arcball implementations but none ...
0
votes
1answer
35 views

How can I take screenshots with two cameras simultaneously in Unity?

I am trying to capture different parts of a scene created in Unity. I have two cameras capturing different parts of the scene. Now, I need to take screenshots using these two cameras simultaneously. ...
0
votes
0answers
21 views

Problem with Cinemachine Collider during occlusion

I have a Cinemachine Free Look camera that is using a Cinemachine Collider with the strategy of pulling the camera forward. After occlusion it looks like the camera relocates in front of the object ...
1
vote
1answer
44 views

How can I make my camera follow the player movement in a different position

Basically my camera follows the character rotation and position, although the position of it its pretty uncomfortable to use, this is what I needed: But this is what the I get: I used a code that ...
0
votes
0answers
22 views

How can I make the camera that follows my character position also follow the character rotation? [duplicate]

So I've tried to make the camera also follow my character rotation, I tried using the same process that I did for the position follow, using quaternion and transform.rotation but it was giving me some ...
1
vote
1answer
36 views

Problem with making camera follow player in Javascript

So I'm testing a few things in Javascript and something I was testing was making the camera follow the player. When I move the player, instead of the dots going away from the player, they follow the ...
0
votes
1answer
21 views

GameObject keeps snapping to camera size on play

I'm in the process of making my GameObject move when I drag it across the screen using touch. But my current issue is when I press play to test the game, game object snaps to the size of my camera on ...
-1
votes
1answer
35 views

how do i clamp my camera's rotation on X and Y?

i'm using a script to make my camera rotate smoothly toward the mouse cursor on the screen. and the only thing i need is to somehow clamp it's rotation on X and Y. here : ...
0
votes
2answers
154 views

Drag 3D camera with mouse cursor

I have a camera that is moved by changing its X and Z coordinates. However, the camera is rotated, so when an object moves by 1 unit in the world, the number of pixels it moves by isn't trivial to ...
0
votes
0answers
31 views

LibGDX: Issues with two viewports, one from stage

I am frustrated.^^ I want to build a game that can run on different screen sizes using LibGDX. The best strategy for me seems to be to use a FitViewport so that I ...
1
vote
3answers
94 views

How to make TEXT RENDER stand facing the camera of my character and also for the camera of simulation?

I have an actor (Minion) with a Text Render just above it mesh: As you have seen, I defined your rotation as absolute, so the text does not rotate along with the actor. In the game the rotation ...
0
votes
1answer
40 views

UI background animation makes camera render beyond canvas, need fix?

I have a background animation for a menu where I have to make the background larger than the canvas and drag it over it. Even though I am using a panel the same size as the canvas as a mask, this ...
0
votes
1answer
40 views

smooth look at only on x and y

i'm using the script down below to make my camera look at mouse x and y position, and it has a limitation for my camera rotation.the problem is the way my camera rotates is not smooth at all.is there ...
0
votes
1answer
40 views

The camera goes up and down when following a rolling sphere

I have this CameraController script attached to my camera, to follow a sphere that moves using WSAD. ...
0
votes
1answer
39 views

Unity - Top Down Perspective Camera to Orthographic size

I have a perspective camera with an fov of 60. It looks at an object from top view with a rotation(90, 0, 0) and position (0, 50, 0) The user has the option to change the camera to orthographic view ...
0
votes
1answer
40 views

Rigidbody character rotation

How could I rotate my character that I'm using a rigidbody to move. I tried using transform.eulerAngles and changing those but the camera feels very jittery.
1
vote
1answer
26 views

Should I use a FOV slider or fixed camera fov?

I'm making a single-player third person 3D adventure game, and I was wondering if I should fix the camera's FOV, or if I should create an in-game slider to change it. If I should create a slider, what ...
0
votes
0answers
30 views

libGDX - Zooming on a specific point in 2D space

I was hoping to modify my game so zooming would focus on a point: the mouse location on desktop or the midpoint between two fingers on mobile. This appears to require a simultaneous zoom and translate....
0
votes
0answers
36 views

Scene dark when perspective camera is far from scenery

I can't find anything about this subject in the docs or forums to know if this is normal behavior: There seems to be a direct correlation between how close to the scenery my camera gets and how ...
-2
votes
1answer
74 views

How can I change position of camera?

I'm working on 3D game, where the player needs to complete 4 play fields called "homes" in level 1, then progress to level 2 which has 4 homes of its own. In level 1, when the player completes the ...
1
vote
1answer
47 views

Testing a Client's Camera in a Multiplayer FPS

I'm attempting to do a logic test regarding a client's camera in a multiplayer FPS in Unity and I'm a little uncertain of which way to implement the functionality. The scenario: - I have a host and ...
0
votes
0answers
17 views

Problem with camera deapth culling only option and objects in front of each other

I have a prefab with 2 cameras. the 1st is rendering the world, the 2nd one all the suff in front of the 1st person characters "face". Now i have a problem with a gun using a muzzleflash - both on the ...
0
votes
0answers
15 views

Unity MainCamera won't rotate

I'm making a player-script/FPS in unity where you walk around with WASD and rotate the camera with mouse x/y axis. The "character"/"Player" should be able to rotate with the mouse X axis. (E.g If you ...
0
votes
1answer
48 views

How can I find the opposite angle and position of the camera?

In this project I have a character and a camera that follows it. The camera has a position relative to the character that was defined as (x = 0, y = 0, z = 0) and also its rotation: I found a value ...
0
votes
1answer
31 views

If my camera does not change position but rotates, Does adding lerp do anything?

If my camera does not change position but rotates, Does lerp do anything? ...
0
votes
0answers
9 views

How to resize Unity Cinemachine Dolly track?

I recently imported a 1:1 scale building .obj model into unity and I'm trying too use cinemachine dolly track to navigate the interior of the building. The problem is that the visual of the dolly ...
0
votes
1answer
30 views

Unity - adding camera constraint to prevent the player from seeing beyond the scene

Like the title says, I'm after some kind of constraint for the camera to prevent the player from seeing beyond the scene and seeing the Skybox. I came across the code to add a ...
0
votes
0answers
24 views

Joystick Orientation Wrong After Camera Rotation

I am using a virtual joystick to move & rotate the player and a touch swipe system for the camera rotation, The problem is that when I rotate the camera (Let's say I rotated the camera to 45 ...
0
votes
1answer
26 views

Face culling all faces that cannot be seen [duplicate]

I'm working on a simple 3d game using the Processing Java environment. I want to optimise my code so I can draw many many 'objects' (the world is made up of many different shaped objects that live ...
0
votes
0answers
32 views

Java game how to fix offset move with mouse drag and reset back to start position

I'm try to make offset x and offset y move correspond with mouse drag movement I tested it. Its work but after I released the mouse and do it again the offset will reset to 0, 0 I tried to fix it by ...
0
votes
0answers
16 views

Shader to Show outline, and transparent backFace

I would like to implement in my game some sort of occlusion for backward wall. I want, when my camera is inside a wall, to be able to "see" the start of the wall, with a transparency effect or watever....
1
vote
2answers
63 views

Static Camera on Endless Runner

I am developing a mobile game in ue4. For this project, I need to have a "static" camera so that the player can move within the frame not affecting camera location and rotation. But as this is an ...
0
votes
1answer
14 views

Culling mask don't work

I have the following setup: MainCamera render everything except ImageTurret layer. TurretCamera render only ImageTurret layer on a RawImage My problem is: MainCamera render everything and ...
-1
votes
1answer
54 views

What is the alternative (new) 3d projection called that solves the stretching / zooming at sides of monitor?

I understand about camera's and projections etc, such that we have distortion and zooming when at the sides of the screen (exacerbated on 21:9 monitors), however a few years ago, in a Unity forum ...
0
votes
1answer
25 views

What is causing my 3rd person camera to lose rotation on the z axis?

I've been working on a 3rd person camera on unity for a couple weeks, but I've pretty much hit a wall, specifically to do with my camera's rotation. When I rotate it on its x and y axis it won't have ...
1
vote
1answer
49 views

Camera that pivots in the direction that the player is moving

I'm trying to recreate Rocket League's freeform (non ball-locked) camera, which basically is a camera that follows the player but pivots to allows face the direction the player is moving in (not ...
1
vote
1answer
26 views

How can I use pan gestures to zoom a camera in and out

I have the following scene tree for my player: They have a Camera2D as a child, which has a script attached to it. How can I make the camera zoom in and out as I ...
3
votes
1answer
47 views

Making the camera look at the player while keeping another object in view

I'm working on a sorta football game where I need my player to always be at the center of the camera view while keeping the ball into view, without any vertical movement. The idea would be for the ...
0
votes
1answer
45 views

How can I use slerp to stop my orbit camera “shortcutting” across to its target position?

I'm working on a camera that moves around the player at a fixed distance. It's the standard right-stick-to-move-cam-around kind. The camera follows the player but stays at a fixed angle to (0,0,1) ...
0
votes
0answers
20 views

Why use a quad background over a camera background

I'm quite new to Unity and after looking at a few tutorials for 2D games, I'm noticing people tend to use a Quad for their background colour. What is the benefit of this over just changing the ...
0
votes
1answer
91 views

Pixel Perfect 2D tiles

I'm trying to make an 64x64 tilemap using Super Tilemap Editor & Unity but my tiles looks terrible. I did my research about pixel perfect 2D and all of the solutions were for pixel art, they didn'...