`hi I’m a total beginner
I was following the brackeys tutorial and and I came to the point where I was supposed to use the CharacterBody2D basic movement script to move the player character and I did but it didn’t work the player didn’t move (or I just didn’t know how to move it) thought maybe I did the instructions wrong so I started from scratch again meticulously following the instructions still same results I’m guessing the script worked but it just isn’t made for the android app or something but i don’t know
how can i fix this?
Post your code. Copy it from the Godot editor as text and post it here, enclosed within three backticks (i.e. ```). Also include a picture of your scene tree.
The problem could be anything, and without you providing us this information, the best we can do is make very bad guesses.
const SPEED = 300.0
const JUMP_VELOCITY = -400.0
# Get the gravity from the project settings to be synced with RigidBody nodes.
var gravity: int = ProjectSettings.get_setting("physics/2d/default_gravity")
func _physics_process(delta: float) -> void:
# Add the gravity.
if not is_on_floor():
velocity.y += gravity * delta
# Handle jump.
if Input.is_action_just_pressed("ui_accept") and is_on_floor():
velocity.y = JUMP_VELOCITY
# Get the input direction and handle the movement/deceleration.
# As good practice, you should replace UI actions with custom gameplay actions.
var direction := Input.get_axis("ui_left", "ui_right")
if direction:
velocity.x = direction * SPEED
else:
velocity.x = move_toward(velocity.x, 0, SPEED)
move_and_slide() ```
yes I’m on android
I didn’t press keys on a keyboard to move the character there were no keys in my screen
is this why i can’t find a way for the character to move ? I feel really dumb right now🤦♂️