Right now the player has a state that will attach them to a wall. This mechanic works perfectly for static platforms. However when an animatable body moves horizontally or vertically, the player won’t move with it.
What would be that best way to make the player attach to a wall?
Yes to both. I have the wall attachment mechanic as a separate state then moving around. The player moves with moving platforms while in other states, it’s just when the player is on the wall that I have this problem.
Interesting that it works, because if platform data was not saved, platform velocity should not be updated as well. Meaning that it returns whatever value from the last successful collision.
Have you set platform_wall_layers property by any chance?
I have the first wall layer set to true, and the moving wall uses the second collision layer. Oddly enough, when I go to change the wall layer to the second collision (the one that the moving wall has), the player will go way faster than the walls speed. So I don’t exactly know what’s going on.
Isn’t it because the player is moved twice? First time by the engine (as the wall platform layer is now set correctly and correctly detected), the second time by your code as you added get_platform_velocity() to the velocity a couple of messages earlier in this thread.