Skip to content

Instantly share code, notes, and snippets.

@MrSimsek
Last active April 2, 2023 15:37
Show Gist options
  • Save MrSimsek/9f136569fa4c03d11468374f050808ae to your computer and use it in GitHub Desktop.
Save MrSimsek/9f136569fa4c03d11468374f050808ae to your computer and use it in GitHub Desktop.
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);
}
}
@Helper-Adish
Copy link

ok

@Ghostraider202
Copy link

ok

@pluto-lab
Copy link

nice

@Shandika-galih
Copy link

nice

@Zubair199
Copy link

Nice thank you for the code

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment