Hey guys!
Got a bug i cannot solve in my 2D character movement.
This is my code
public class Movement : MonoBehaviour {
public Rigidbody2D rb;
public float speed = 2f;
void Start () {
rb = GetComponent<Rigidbody2D>();
}
void FixedUpdate () {
float x = Input.GetAxis("Horizontal");
float y = Input.GetAxis("Vertical");
Vector2 vel = new Vector2(x * speed, y * speed);
rb.velocity = vel;
}
}
This scripts is active on my character. My character has a Rigidbody2D (dynamic, mass and gravityscale = 1) and a box collider 2D,not changed anything so everything is quite standard.
Now when my movement script is active, my character seems to fall quite too slowly, as soon as i deactive it the character falls quite normale. I cannot see the reason for this behavior, but i am quite new to programming as well, so i do not know too much =D
I`ve tried to use different commands to move the character, but the problem was always the same
Thanks for any kind of help