유니티 공 굴러가는 게임 소스코드
using System.Collections; using System.Collections.Generic; using UnityEngine; public class PlayerBall : MonoBehaviour { public float jumpPower = 10; Rigidbody rigid; private void Awake() { rigid = GetComponent(); } private void Update() { if (Input.GetButtonDown("Jump")) { rigid.AddForce(new Vector3(0, jumpPower, 0), ForceMode.Impulse); } } private void FixedUpdate() { float h = Input.GetAxisRa..
프로그래밍/유니티
2022. 9. 6. 07:10