-
[Unity] 점프 기능 구현Unity/게임 만들어보기 기록장 2022. 10. 21. 18:59728x90
using System.Collections; using System.Collections.Generic; using UnityEngine; public class BirdJump : MonoBehaviour { Rigidbody2D rb; public float jumpPower; // Start is called before the first frame update void Start() { rb = GetComponent<Rigidbody2D>(); } // Update is called once per frame void Update() { if (Input.GetMouseButtonDown(0)) { rb.velocity = Vector2.up * jumpPower; //(0,3) } }
점프 파워조절
728x90'Unity > 게임 만들어보기 기록장' 카테고리의 다른 글
[Unity] Score 스크립트 만들기 (0) 2022.10.22 [Unity] Prefab을 이용하여 파이프 만들기 (0) 2022.10.22 [Unity] 점프 기능 구현을 위한 Visual Studio 환경세팅 (0) 2022.10.21 [Unity] 중력 추가하기 (0) 2022.10.20 [Unity] 애니메이션 추가하기 (0) 2022.10.20