Roll a Ball 2 of 8
Moving the Player
Script error
this is my code
"
using UnityEngine;
using System.Collections;
public class PlayerController : MonoBehaviour {
public float speed = 0.0f;
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);
}
}
"
error "Cannot implicitly convert type ‘float’ to ‘UnityEngine.Vector3’
I am just a biggner so please provide me solution as soon as possible.