반응형
uinty 캐릭터 대쉬
-
unity C# 캐릭터 대쉬카테고리 없음 2023. 2. 7. 14:43
using System.Collections; using UnityEngine; public class Dash : MonoBehaviour { public float dashSpeed = 10f; public float dashTime = 0.5f; private float currentDashTime; private Rigidbody2D rb; private bool isDashing = false; void Start() { rb = GetComponent(); } void Update() { if (Input.GetKeyDown(KeyCode.Space) && !isDashing) { isDashing = true; currentDashTime = dashTime; Vector2 dashDirec..