Skip to content

Jogo de segurança do trabalho #52

Description

@MarcosAndrade39

using UnityEngine;

public class PlayerController : MonoBehaviour
{
public float speed = 5f;
private Rigidbody2D rb;
private float moveInput;

void Start()
{
    rb = GetComponent<Rigidbody2D>();
}

void Update()
{
    moveInput = Input.GetAxis("Horizontal");
    rb.velocity = new Vector2(moveInput * speed, rb.velocity.y);
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions