A REAL 2d character controller script

Ive looked at other topics and nothings has helped me. All I need is a 2d platformer. Exactly like the tutorial but more 2d looking. I can handle the looks but i really need a script cause Im not a scripter. Can someone give me a script of that nature? Thanks.

This might be able to help :slight_smile: Unity 2D tools for game dev – evolved for optimal graphics performance

Did you try changing the camera to orthographic?

Like this?

http://thecreativecoder.blogspot.com/2010/06/unity-2d-side-scroll-script.html

Awesome! What do I attach that script to? a game object? A empty one? The camera? what?

You attach the script to the camera. The target is your player.

Nevermind. I figured it out and it works great! Thanks! But that was a script for the camera. How do I keep the character on one axis? Because right now Im using the basic 3D character controller. How do I get a 2D character controller

Perhaps you could find what detects keypresses and just remove the function. I don’t really know.

Thats what I thought, but Im not very good at understanding script. And it isnt on the “more obvious” script. Maybe you could try and edit it.

My Character movement script:

var speed = 3.0;
var rotateSpeed = 3.0;
function Update ()
{
var controller : CharacterController = GetComponent(CharacterController);
transform.Rotate(0, Input.GetAxis ("Horizontal") * rotateSpeed, 0);
var forward = transform.TransformDirection(Vector3.forward);
var curSpeed = speed * Input.GetAxis ("Vertical");
controller.SimpleMove(forward * curSpeed);
}
@script RequireComponent(CharacterController)

I have everything figured out except how to jump. Ive tried to modify my movement script but nothing works. I promise that this is the last question! Haha