Converting JS to C#

Hello Everyone, Unity and Scripting noob here. I am trying to convert my playercontrol.js file to a C# file for my game where the player is an sphere that traveling through a 3D city maze. I believe I got most of it done but there is an error with line 55 under void FixedUpdate ():

[private movement Vector3 = new Vector3 (moveHorizontal,0.0f,moveVertical); ]

The error is [Assets/Script/PlayerControl.cs(55,23): error CS1525: Unexpected symbol `private’].

I took out the private to see what happened and put float it said I have no semicolon (:wink: on movement line and also highlighted void IsGround. I know the syntax is off. Please help me.

(In C# should I put all of my variables at the top of the page? Whereas Java script you can write them anywhere as long as they have var in front of them?)

using UnityEngine;
using System.Collections;

public class PlayerControl : MonoBehaviour 
{
	//positioning
	public float speed = 2;
	public float distToGround;
	public Transform centerOfMass;
	public Transform cam;

	//shooting
	public GameObject shot;
	public Transform shotSpawn;
	public float fireRate;
	private float nextFire;
	public GameObject target;


	void Start()
	{
		// get the distance to ground
		distToGround = collider.bounds.extents.y;
	}
	
	void IsGrounded()
	{
		return Physics.Raycast(transform.position, -Vector3.up, distToGround + 0.1);
	}
	
	void Update ()
	{
		if (Input.GetButton("Fire1") && Time.time > nextFire) 
		{
			nextFire = Time.time + fireRate;
			Instantiate (shot, shotSpawn.position, shotSpawn.rotation); //as GameObject;
			//audio.Play();
			Attack();
		}
	}
	
	private void Attack()
	{
		HealthBar eh = (HealthBar)target.GetComponent("HealthBar");
		eh.AdjustCurrentHealth(-10);
	}
	
	void FixedUpdate () 
		
	{
		//THe directions the player peice will go based the keyboard arrows
		float moveHorizontal = Input.GetAxis ("Horizontal");
		float moveVertical = Input.GetAxis ("Vertical");
		
		private movement Vector3 = new Vector3 (moveHorizontal,0.0f,moveVertical);

		
		
		// When the player peice turns left or right, it tilts slightly
		rigidbody.rotation = Quaternion.Euler (0.0f,rigidbody.velocity.x, 0.0f);
		
		
		// The acceleration for the player peice 
		rigidbody.velocity = movement * speed;
		
		
		// The Camera is following the player peice
		rigidbody.AddForce (transform.rotation * cam.transform.forward * moveVertical);
		rigidbody.AddForce (transform.rotation * cam.transform.right * moveHorizontal);
	}
}

The error is correct, one, private isn’t needed whatsoever in a variable that is in the local scope of a method(in this case FixedUpdate.

on line 55 change this:

private movement Vector3 = new Vector3 (moveHorizontal,0.0f,moveVertical);

to:

Vector3 movement = new Vector3 (moveHorizontal,0.0f,moveVertical);