Character Controller for 2.5d game in C#

I'm trying to move a character in a 2.5d game im making. I'm not very familiar with C# So this is what I have...Any help would be greatly appreciated

using UnityEngine;
using System.Collections;

//#pragma strict
public class NewBehaviourScript : MonoBehaviour {

// Use this for initialization
void Start () 
    int keyboardSpeed = 20;

// Update is called once per frame
void Update () 


void FixedUpdate () 
    int keyboardX = Input.GetAxis("Horizontal") * keyboardSpeed * Time.deltaTime;
    int keyboardY = Input.GetAxis("Vertical") * keyboardSpeed * Time.deltaTime;

    int newPos = rigidbody.position + Vector3(keyboardX, keyboardY, 0.0);

    newPos.x = Mathf.Clamp(newPos.x + keyboardX, -30, 32);
    newPos.y = Mathf.Clamp(newPos.y + keyboardY, -12,4);
    transform.position = newPos;
@script RequireComponent(Rigidbody)


You could, instead of just setting the position yourself do a CharacterController.Move so that you get collision. Another thing you might want to keep in mind. If you are locking the z-axis of the player or want to depend on that axis not changing. Any rounded sides can slightly change that axis's value. I am sure there are other things but that is what comes off the top of my head.

Won’t work, the keyboardSpeed variable is only existent in void Start function. Do it just after the public class part, or make it a public variable.