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
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))
}
Details
Go version
1.16.2
Godot version
3.2.3
Godot-Go version/commit hash
Current
OS
Arch Linux 5.11.6
The text was updated successfully, but these errors were encountered:
Trey2k
changed the title
KinematicBody2D Move and slide crashes game
KinematicBody2D Move and Collide crashes game
Mar 25, 2021
Description
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.
Details
The text was updated successfully, but these errors were encountered: