New answers tagged

0

I think it should be like this • Select the main camera • Click on "GameObject" in the top panel • Click on "Align with view"


1

Unchecking "Directly to Camera Target" on the Post Processing Layer component did the trick. I am not completely certain what the option does yet, but I am guessing it may mean that the post-processing renders its output after all other camera renders, instead of during that particular camera's depth. Unchecking "Directly to Camear Target" seems to muck ...


1

Using a simple truncation as suggested by @Pikalek does only work with positive numbers. Truncating positive numbers is equivalent to the floor-operator but with negative numbers it is equivalent to the ceil- operator. To make it properly work in both cases you need to explicitly use the floor operation. leftCameraBorder = centerX - camera.width / 2 ...


0

This is a straightforward application of Mathf.Clamp(value, min, max). Ordinarily I'd recommend caution calculating new orientations from Euler angles, but for camera orientation it's typically safe enough. You might want to pull back slightly from 90, say 80 degrees, so you don't hit nasty behaviour right at the poles. // Correct for deltaTime so your ...


0

Converting any coord to a tile is done by dividing by the tile size & discarding the decimal part. So for instance, the camera focus will be in tile: cameraTileX = (int)(cameraX / tileSizeX); cameraTileY = (int)(cameraY / tileSizeY); From there, you can calculate the upper leftmost tile (subtract half the screen size to the camera coord) & the ...


0

You can use if condition such as: float v = verticalSpeed * Input.GetAxis("Mouse Y"); if (v > 100) then //100 your limit {v= 50} else {v=30} or you can use math.sign function which gives you +1,0,-1 if the result for your case v > 0 it returns +1 if it is zero than 0 if it is negative then it is -1 you can limit your camera by ...


1

What troubles me is you're not using quaternions for an Arcball camera. My answer comes from some of my DirectX code so if you see some strange behavior, I probably messed it up for OpenGL ;) it is far more simple to use quaternions, even if that sounds barbarian to you, it is easier to wrap ones mind around quaternions than matrices (of course in the ...


0

One solution to your problem would be to render your ship with one camera and everything else with another. Both cameras have the same position and rotation. The one rendering everything but your ship has a high FOV. This way your ship will look normal but your environment will be warped.


Top 50 recent answers are included