Does the issue occur in the editor or during gameplay?
Gameplay.
If it's a gameplay issue, please specify which movement system and camera type you're using (free movement vs. grid movement, third-person vs. first-person) or N/A if not applicable:
Real-Time, Grid Movement, Third Person. (Likely applies to first-person as well.)
Briefly describe the issue you're experiencing:
Using the put_player() function and then removing the last tile the player was on will cause any attempt to move the player failing. The player will loop their walking animation and the console will endlessly print the below error messages. This does NOT occur when using the move_player() function.
Are there any errors in the in-game debug console or external console window?
SCRIPT ERROR: process_movement: Invalid operands 'float' and 'Nil' in operator '*'.
At: res://character.gde:1820
SCRIPT ERROR: get_speed: Invalid get index 'is_conveyor' (on base: 'previously freed instance').
At: res://character.gde:887
Based off the above and testing: It looks like that when the tile is removed, the engine's process_movement function fails because it is attempting to reference the last tile the player was on, which is now NULL (Nil). The get_speed function fails for the same reason (no way to index is_conveyor on a NULL instance). I'm not sure why this doesn't seem to apply in cases where move_player() is used instead.
Provide the steps necessary to reproduce the issue:
The quickest way to reproduce:
1: Create a barebones project.
2: Create a script, name it whatever you like but the shorter the better. (In this case, I named it "pt".)
3: Insert the following two functions. (Note that you can also reference said tiles via entity IDs or another form of referencing tiles and the result will be the same.
put_player(player.front_tile);
remove_entity(player.back_tile);
4: Quick play. Move your character around first to confirm he can move.
5: Open the console, type in the following and execute:
exec pt
6: Attempt to move. Note results.
Provide a download link to the bare bones project (strongly recommended if it's an in-game issue, since this helps significantly when attempting to reproduce it; the report will also be given more priority in this case):
https://drive.google.com/drive/folders/1WbpQyKBoCNy6hFT3bHnBWcoG2JHj9qHe?usp=sharing
I have previously reported this bug, but I was mistaken at the time. I had previously believed the error was due to modifying map navigation. Based off what I discovered and the ability to replicate it, I have narrowed down the cause to be removing the last tile you stood on during gameplay.
How I discovered: Working on an adventure game, I can simulate the player jumping between tiles by using invisible tiles. Using move_player() to simulate a jump for example. I attempted using put_player() in cases where moving between invisible tiles was not possible (tiles are not adjacent), leading to discovery.
Please let me know if there is any further information I can provide.