Trying to create a very basic 2.5D Camera Perspective.

So, as the title suggest I want to maintain 2D movements while using 3D models to obtain depth in my game, the camera will be tilted and follow the player horizontally and some restrictions on vertical movement.

I have been looking over some tutorials for a couple of days now and nothing really advance. I was wondering what are some nice references to help me build this camera + player object.

How I was hoping to get this working as to have an object and my “player” and have the camera follow the player. So, the player’s movement is translated to the camera’s movement as well.

The thing is I have sort of got it working, but when I add in a rigidbody into my “player” it tends to wobble completely out of control and it is a big mess keeping it straight up. My player so far is a capsule since I have no art, but I just want to get the logic down. Also, what are some dependencies that one might need for creating this type of camera. I understand the basic speed, jumpSpeed, etc.

Thanks in advance.

There is no difference between what you want to achieve, in a 2.5D setting, 3D setting or 2D.

What you simply need is you camera to follow your player. This could be done in update or by having the camera share a common transform with the player. So, when the player moves, the camera moves.

Placing limits vertically can be done thru triggers or again, in Update.

You can do something like this: (Simple code).

public Transform Cam;
...
// C#
void Update()
{
    Cam.transform.position = new Vector3(this.transform.position.x,0,0);
}
...

To solve that wobbling you might want to look into the ‘Constraint’ fields of the ‘RigidBody’ and lock the object into only 2 axis. To solve the ‘wobbling’ you described I think you’d do good on miguelvesga’s example, except you might want to stabilize ‘this.transform.rotation’ instead of ‘position’.