Godot v4.3
Goodday everyone, hope this finds you well, I’m currently making my first game and had a little problem, my character slides alot, alottt, when it has momentum it doesn’t stop but continues sliding, what do I do?
Godot v4.3
Goodday everyone, hope this finds you well, I’m currently making my first game and had a little problem, my character slides alot, alottt, when it has momentum it doesn’t stop but continues sliding, what do I do?
Looks like low gravity, if it’s a rigid body maybe you can increase the physics material’s friction.
can you paste your code?
Sure here’s the code:
extends CharacterBody2D
const GRAVITY = 200
const THRUST = -500
const ROTATION_SPEED = 2.0
func _process(delta):
velocity.y += GRAVITY * delta
if Input.is_action_pressed(“ui_left”):
rotation -= ROTATION_SPEED * delta
elif Input.is_action_pressed(“ui_right”):
rotation += ROTATION_SPEED * delta
if Input.is_action_pressed(“ui_accept”):
var thrust_direction = Vector2(0, 1).rotated(rotation)
velocity += thrust_direction * THRUST * delta
move_and_slide()
func _on_area_2d_body_entered(body: Node2D) → void:
get_tree().reload_current_scene()