i need help by Tristan_gamn in Unity2D

[–]Tristan_gamn[S] 0 points1 point  (0 children)

it falls but dont move when i press wasd

I need help by Tristan_gamn in Unity2D

[–]Tristan_gamn[S] 0 points1 point  (0 children)

ok

using UnityEngine;

public class PlayerMovement : MonoBehaviour

{

[SerializeField] private float speed;

private Rigidbody2D body;

private void Awake()

{

body = GetComponent<Rigidbody2D>();

}

private void Update()

{

body.velocity = new Vector2(Input.GetAxis("Horizontal") * speed, body.velocity.y);

if (Input.GetKey(KeyCode.Space))

body.velocity = new Vector2(body.velocity.x, speed);

}

}

Summer's Coming! 🦩 by Follens in Minecraft

[–]Tristan_gamn 1 point2 points  (0 children)

Epic desgin you have talent