How do i fix this error? Error CS1502 CS1503
Assets/Scripts/PlayerController.cs(17,83): error CS1502: The best overloaded method match for UnityEngine.Vector3.Vector3(float, float, float)' has some invalid arguments
Assets/Scripts/PlayerController.cs(17,83): error CS1503: Argument #2' cannot convert double' expression to type `float'
I am trying to do the roll a ball but i keep getting this compiling error How do i fix this
using UnityEngine; using System.Collections;
public class PlayerCon: MonoBehaviour {
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);
}
}
Answer by AurimasBlazulionis · Oct 27, 2016 at 08:22 PM
Try changing 0.0f
to 0f
or just 0
. If that does not work somehow, then change it to (float)0
.
Your answer
Follow this Question
Related Questions
Ledge Climb (Sort of working) Need help 0 Answers
How to find a "Object too large" error. 0 Answers
Error, host set to 1 Answer
Object position/rotation after animation has finished to play. 0 Answers
Unity Package Manger Issue 1 Answer