Freeze on Debugging

Hi guys,

Here is a simple scene, just a basic setup of a character. No loop in the script. Godot 4.5
My PC hardware is not bad, i7 14th gen, 32GB RAM, RTX 3060.

And I got freeze when run debugging. This happens a bit randomly. I have to restart my PC and sometimes the problem gone.

Video link, I can’t upload video become I’m still a new member

Do you know what may cause this problem?
Thank you.

There is no way for any of us to know why your game might freeze. Look into what scripts do, the reason is there somewhere.

Can you expand on what you mean by freeze?

as I told, the script is only a basic movement, no looping or heavy compute:
extends CharacterBody2D

@export var SPEED: float = 200

@onready var anim: AnimationPlayer = $AnimationPlayer

func _physics_process(delta: float) -> void:
	if Input.is_action_pressed("move_down"):
		anim.current_animation = "move_down"
		velocity = Vector2.DOWN
		position += velocity * delta * SPEED
	elif Input.is_action_pressed("move_up"):
		anim.current_animation = "move_up"
		velocity = Vector2.UP
		position += velocity * delta * SPEED
	elif Input.is_action_pressed("move_right"):
		anim.current_animation = "move_right"
		velocity = Vector2.RIGHT
		position += velocity * delta * SPEED
	elif Input.is_action_pressed("move_left"):
		anim.current_animation = "move_left"
		velocity = Vector2.LEFT
		position += velocity * delta * SPEED
	move_and_slide()

Just like the clip I have attached in the google drive link. When I press run debug, it just freezes and take like 1 or 2 mins to really start.

Try changing renderer mode to Compatibility?

First off, try one of the demo projects. If it works ok then you can be sure it is something about your project.
Then, you could try googlin “takes long time to start”, which describes your situation better than “freezing”. There is a number of things to try.

1 Like