- Home /
Question by
unity431 · Jan 08, 2016 at 06:09 AM ·
scripting problemscript error
Script error
I keep on getting this error in my script (UnityEngine.Component.GetComponent(System.Type)' cannot be used with the type arguments) what seems to be the problem with my script,Thanks
using UnityEngine;
using System.Collections;
public class PlayerMovement : MonoBehaviour {
public float movespeed;
private Vector3 input;
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
input = new Vector3 (Input.GetAxis ("Horizontal"), 0, Input.GetAxis ("Vertical"));
GetComponent<Rigidbody> (input).AddForce (movespeed);
}
Comment
Answer by allenallenallen · Jan 08, 2016 at 06:10 AM
GetComponent<Rigidbody>().AddForce (movespeed);
I don't know why you added input
Your answer
Follow this Question
Related Questions
How to control ios statusbar with script? 1 Answer
How can i set transform.position on y ? And why i'm getting error cannot convert double to float ? 3 Answers
Object flashing in and out every frame (because of my script) 0 Answers
Movement Script stops working 0 Answers
Having trouble using SendMessage 1 Answer