Posted June 26, 2021 by wilkgames
#tikustales #rotatingplatform #platformdesign
Good day, all.
When I first started implementing moving platforms, there was an issue where the character would simply slide in place while the platform passes beneath them. Perusing the internet yields different suggestions as fixes, but I notice that a majority of them involve making the character a child of the platform while they're on it. That solution did not work out well for my game because of how I made my character controller, so I went the other route: calculating an offset of the 'ground object' and adding it to the position of the character. It has been working well so far.
As the main disk rotates, so do the colliders, so they basically are "moving platforms" rather than rotating ones, and the character is able to stay on the trajectory while standing on the disk. If the character was to stand on the disk itself, the sliding issue would remain.
Of course, the whole issue could probably be avoided by simply making the disk dangerous to step on:
This second workaround is probably only applicable to specific situations. In this particular scenario, I prefer it, honestly, as it adds a bit more challenge.
There are probably other solutions out there that involves calculating rotations and stuff, but I feel this is enough for my game for now.
TLDR: Add separate colliders to a rotating platform that act as individual 'grounds', so as the main disk rotates in place, these individual grounds become 'moving' platforms, allowing the character to follow their path.