You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 20, 2025. It is now read-only.
When calling the MoveAndCollide function for the kinematicBody2D the game crashes right after launch with no error, the code snippet below works fine with the line commented out. I can just set the position but collisions will not be calculated then.
// X_Process is called every frame
func (r *Robot) X_Process(delta gd.Real) {
velocity := gd.NewVector2(0, 0)
if godot.Input.IsActionPressed("ui_right") {
velocity.SetX(velocity.GetX() + 1)
}
if godot.Input.IsActionPressed("ui_left") {
velocity.SetX(velocity.GetX() - 1)
}
if godot.Input.IsActionPressed("ui_down") {
velocity.SetY(velocity.GetY() + 1)
}
if godot.Input.IsActionPressed("ui_up") {
velocity.SetY(velocity.GetY() - 1)
}
if velocity.Length() > 0 {
normal := velocity.Normalized()
velocity = normal.OperatorMultiplyScalar(speed)
}
r.MoveAndCollide(velocity.OperatorMultiplyScalar(delta))
}