mirror of
https://github.com/boudji-ludwig-pett/cnam-geometry-dash.git
synced 2025-05-08 17:54:12 +02:00
21 lines
533 B
C#
21 lines
533 B
C#
using UnityEngine;
|
|
|
|
public class CameraController : MonoBehaviour
|
|
{
|
|
public float moveSpeed = 10f;
|
|
|
|
void Update()
|
|
{
|
|
float horizontalInput = Input.GetAxisRaw("Horizontal"); // ← → ou A D
|
|
float verticalInput = Input.GetAxisRaw("Vertical"); // ↑ ↓ ou W S
|
|
|
|
Vector3 movement = new Vector3(
|
|
horizontalInput * moveSpeed * Time.deltaTime,
|
|
verticalInput * moveSpeed * Time.deltaTime,
|
|
0f
|
|
);
|
|
|
|
Camera.main.transform.position += movement;
|
|
}
|
|
}
|