Add optional param `cancel_sliding` to `move_and_collide`
This PR exposes the p_cancel_sliding as a parameter to move_and_collide in ClassDB (which GDScript uses). This makes it possible to specify either to cancel sliding or not.
As @smix8 said in the proposal:
The problem here is more the method binding, e.g. GDScript users think they are calling
move_and_collide()but what they are really calling is a_move()wrapper function that omits parameters.
~~Open questions~~
~~Currently, there's a discrepancy between 2D and 3D in the cancel_sliding default values. The original C++ move_and_collide p_cancel_sliding parameters change between versions (being true on 2D, and false on 3D).~~
~~I chose to keep that default behavior for the exposed ClassDB move_and_collide, but maybe it should be better to expose the same default for end-users.~~
(update: it was me that caused that discrepancy but didn't realized it. Thank you @AThousandShips!)
MRP
Fixes
Fixes godotengine/godot-proposals#9253
Thank you a lot for working on this!
It seems like merging is blocked due to failed checks for the linux editor.
Indeed. It's because the extra argument makes this a breaking change (at least for GDExtension). It would need a compatibility method (wouldn't know how to do it right now).
I'm on it. This PR slipped between my cracks, sorry!
Can this make the cut for 4.3 still? Unsure, but worth noting.