I'm having issues when loading my project in the latest engine alpha. Player movement no longer works in Godot 3.1 alpha 3 and alpha 4, but it worked fine up until alpha 2.
The player is a KinematicBody2D and I'm using moveandcollide(). This is the relevant part of the code, I think:
if not is_moving and direction != Vector2():
target_direction = direction.normalized()
if grid.is_cell_vacant(get_position(), direction):
target_pos = grid.update_child_pos(get_position(), direction, type)
is_moving = true
#print("current room: " + str(get_room()))
if global.on_episode == false and global.HP > 0: get_worldmap_coordinates()
speed = MAX_SPEED
velocity = speed * target_direction * delta
var pos = get_position()
var distance_to_target = pos.distance_to(target_pos)
var move_distance = velocity.length()
if move_distance > distance_to_target:
velocity = target_direction * distance_to_target
is_moving = false
"grid" is a TileMap and the parent of the player.
My player script is a bit complex (and messy at parts, since I'm an amateur) and it depends on other scripts, so the problem might lay elsewhere. This is the complete script, for reference: https://gitlab.com/alforiumstudios/monsterembassy/blob/master/game_source/system/player/player.gd
The project is open-source, so you can even download the entire game and try it out yourself. The player gets stuck and doesn't move.
I've been looking at the engine's change logs, pull requests, etc. but I can't figure out what's changed to suddenly break this. Has there been any important changes in stuff like framerate calculation, collision, etc.? Or perhaps breaking changes in how TileMaps are handled?
I'd really appreciate any help!