Initial commit
This commit is contained in:
16
Assets/Scripts/PlayerBergerak.cs
Normal file
16
Assets/Scripts/PlayerBergerak.cs
Normal file
@ -0,0 +1,16 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
public class PlayerBergerak : MonoBehaviour
|
||||
{
|
||||
public float speed = 1.5f;
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (Keyboard.current.spaceKey.wasPressedThisFrame || Gamepad.current?.buttonSouth.isPressed == true)
|
||||
{
|
||||
transform.Translate(transform.forward * speed * Time.deltaTime);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user