- Home /
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);
}
}
Comment
Answer by ricardo_arango · Oct 10, 2014 at 08:07 PM
You need to use dots '.', for floating point numbers:
Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
OnCollisionEnter not working 1 Answer
Alarm lights not changing 1 Answer