18 lines
385 B
C#
18 lines
385 B
C#
using UnityEngine;
|
|
|
|
public class Player : MonoBehaviour
|
|
{
|
|
public Rigidbody2D rb;
|
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
|
void Start()
|
|
{
|
|
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
rb.linearVelocity = new Vector2(Input.GetAxis("Horizontal"), rb.linearVelocityY);
|
|
}
|
|
}
|