My character won't move in C#.

I’ve translated my controller to C# but I’ve ran into a little snag that may be little or be gargantuan mass chaos. I must know is the problem the vector3 variable at the top. I believe it was the root of my problem on the other script but I don’t see why it would do that. I’ve checked the values on movedirection and they are changing but my object is not moving. If I haven’t been clear enough or you need help deciphering my script leave a comment. If anyone can see the problem or can help to narrow it down please help I know my script is a mess.

public float currentSpeed;
public float walkSpeed = 6.0f;
public float maxSpeed = 15.0f;
public bool swiming = false;
public bool climbing = false;
public float rotateSpeed = 100.0f;
public bool checker  = false;
public Vector3 moveDirection = Vector3.zero;
public float jumpSpeed = 8.0f;
public float sprintCurHealth = 0f;
public int sprintMaxHealth = 50;
private int _PercentFull = 100;
public bool isSprinting = false;
float gravity = 20.0f;

private bool grounded = false;
static bool allowMove = true;
static bool playerSneaking = false;
void Awake (){
sprintCurHealth = sprintMaxHealth;
}
void Update(){
if (isSprinting){
currentSpeed = maxSpeed;
}
else {
currentSpeed = walkSpeed;
}
if (Input.GetKey("left shift")){
if (Input.GetKey("w")){
if (sprintCurHealth > 0){
	isSprinting = true;
}
if (sprintCurHealth <= 0){
	isSprinting = false;
}}
}
if (sprintCurHealth > sprintMaxHealth){
sprintCurHealth = sprintMaxHealth;
}
if (isSprinting){
sprintCurHealth =- Time.deltaTime;
	}
if (!isSprinting){
sprintCurHealth =+ Time.deltaTime;
	}


transform.Rotate(0,Input.GetAxis("Mouse X") * rotateSpeed * Time.deltaTime, 0);
}

void FixedUpdate() {
   if (Input.GetKeyDown("q")){
 //moveDirection.y = jumpSpeed;
animation.Play("roll");
//Roll();
 
}
if(allowMove){
 
if (grounded) {
moveDirection = new Vector3(Input.GetAxis("Horizontal")*currentSpeed, 0, Input.GetAxis("Vertical")*currentSpeed);
moveDirection = transform.TransformDirection(moveDirection);
       
moveDirection *= currentSpeed;
if(!swiming){
if (Input.GetButton("Jump")) {
moveDirection.y = jumpSpeed;
            
}
if (Input.GetKeyDown("q")) {
      
moveDirection.y = jumpSpeed;
//Roll();
}
}
}
else if (climbing){
  
moveDirection = new Vector3(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"),0);
moveDirection = transform.TransformDirection(moveDirection);
moveDirection *= currentSpeed;
    
}
}
if(swiming){
currentSpeed = walkSpeed;
}
}

First off, it’s really hard to debug codeif it’s written like this, so I took some time and tabbed everything to their respective places (and changed some code here and there).

As for the bug your script has: I’m not behind a PC with unity right now, but it may be because you use a Vector3 to calculate the position of the player (a proxy), but you never apply the proxy to the position anywhere in the script.

just put this line of code after the final if(Swimming==true) statement and see if that fixes it. I allready put where it should, but commented out.

transform.position+=moveDirection;

If I have the time, I may get back on this and see if I can get it working.

GLHL

EDIT: For script look in comment