messing around with the droplet
This commit is contained in:
@@ -2,15 +2,27 @@ using UnityEngine;
|
||||
|
||||
public class DropletMovement : MonoBehaviour
|
||||
{
|
||||
|
||||
public float moveSpeed = 5f;
|
||||
|
||||
private Rigidbody2D rb;
|
||||
private Vector2 movement;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
rb = GetComponent<Rigidbody2D>();
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
movement.x = Input.GetAxisRaw("Horizontal");
|
||||
movement.y = Input.GetAxisRaw("Vertical");
|
||||
}
|
||||
|
||||
private void FixedUpdate()
|
||||
{
|
||||
rb.linearVelocity = movement.normalized * moveSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user