- Home /
What is the error?
the console is saying UnityEngine.Vector3' does not contain a constructor that takes `4' arguments
code:
using UnityEngine; using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed;
private Rigidbody rb;
void Start ()
{
rb = GetComponent<Rigidbody> ();
}
void FixedUpdate ()
{
float moveHorizontal = Input.GetAxis ("Horizontal");
float moveVertical = Input.GetAxis ("Vertical");
**Vector3 movement = new Vector3 (moveHorizontal, 0,0f, moveVertical);**
rb.AddForce (movement * speed);
}
Comment
Your answer
Follow this Question
Related Questions
Punching objects (C#) 1 Answer
[Solved]List.FindIndex error C# 1 Answer
Vector3 multiplied by its magnitude results in infinity? 1 Answer