Question by
someonehere12 · Jul 14, 2017 at 04:32 AM ·
scripting problem2d game
Can someone help me with the movement of the ufo from the ufo tutorial
I did the script and I added to the ufo but It doesn´t move,here is the script: using System.Collections; using UnityEngine;
public class playercontrol : MonoBehaviour {
public float Speed;
private Rigidbody2D rb2d;
void Start()
{
rb2d = GetComponent<Rigidbody2D> () ;
}
void fixedupdate()
{
float movehorizontal = Input.GetAxis ("Horizontal");
float movevertical = Input.GetAxis ("Vertical");
Vector2 movement = new Vector2 (movehorizontal,movevertical);
rb2d.AddForce (movement*Speed);
}
there is something wrong?
Comment