Last active
April 2, 2023 15:37
-
-
Save MrSimsek/9f136569fa4c03d11468374f050808ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
public class CubeMovement : MonoBehaviour { | |
public float speed = 10f; | |
// Update is called once per frame | |
void Update () { | |
float horizontalMovement = Input.GetAxis("Horizontal") * Time.deltaTime * speed; | |
float verticalMovement = Input.GetAxis("Vertical") * Time.deltaTime * speed; | |
transform.Translate(horizontalMovement, 0, verticalMovement); | |
} | |
} |
nice
Nice thank you for the code
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nice