Created
March 8, 2025 02:39
-
-
Save lamarmarshall/f8800d029b02168f36a0de70218277f5 to your computer and use it in GitHub Desktop.
godot, rpg movement
This file contains hidden or 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
extends CharacterBody2D | |
var speed: int = 250 | |
func _process(delta: float) -> void: | |
player_movement() | |
func player_movement() -> void: | |
velocity = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down") | |
velocity = velocity.normalized() * speed | |
move_and_slide() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment