this my script=using UnityEngine;
using System.Collections;
public class Movimiento1 : MonoBehaviour {
public Vector2 speed = new Vector2(50,50);
private Vector2 velocity;
void Update () {
float inputX = 0;
float inputY = 0;
inputX = Input.GetAxis("Horizontal");
inputY = Input.GetAxis("Vertical");
//Ahora muevo segun la direccion
// I already got the module(speed vector) and now I got the direction represented with the variables inputX and inputY,
//so now i cant mae the velocity vector:
velocity = new Vector2(speed.x * inputX, speed.y * inputY);
void FixedUpdate() {
rigidbody2D.velocity = velocity;