Literally just started coding in c#, having error cs1729

I copied the example script exactly, but it isn’t working. I know I’m a noob, but can you please help? The error is saying:Assets/Scripts/PlayerController.cs(11,83): error CS1729: The type UnityEngine.Vector3' does not contain a constructor that takes 4’ arguments

using UnityEngine;
using System.Collections;

public class PlayerController : MonoBehaviour 
{
	void FixedUpdate ()
	{
		float moveHorizontal = Input.GetAxis("Horizontal");
		float moveVertical = Input.GetAxis("Vertical");

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

		rigidbody.AddForce(movement);
	}
}

1 Answer

1

You need to use dots ‘.’, for floating point numbers:

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