I’m looking to implement a character controller for a multiplayer 2d platformer, and move_and_slide() immediately supports a bunch of incredibly useful behaviour for small quirks like one-way platforms and slopes.
The problem is that move_and_slide() automatically multiplies CharacterBody2D velocity by its own delta, which cannot be overwritten normally. For our specific multiplayer context, we need the physics to be deterministic, and overwriting the delta would be the only reasonable solution here beyond recreating it with move_and_collide(). There exists a pull request to allow the delta to manually be overwritten, but this has yet to be implemented.
My question is, has anyone previously “mocked” the move_and_slide() behavior with move_and_collide()? I’m pulling my hair out whilst swimming through source code in attempts to replicate it, but I’m beyond stumped, and wondering if anyone has previously done this with GDscript.
(I’ll assume your move_and_slide() call in your example is move_and_collide())
This is close to what’s listed in the 4.4 documentation, which works for mocking the basic “sliding” behaviour, but I’m also trying to recreate the more helpful additions like constant speed & snapping on slopes - essentially recreating a move_and_slide() call 1:1 without the delta.