Collision and pivot!

Started by rmonic79, Thu 18/04/2019 11:02:42

Previous topic - Next topic

rmonic79

Hi guys i have multiple characters and i'm trying to have them to not overlap when walking in narrow places. i'm using blocking width and blocking height and , of course, the characters are solid. My issue is that it seems that the direction of this function extrude not centered (regarding characters positions) so i'm wondering if there's a way to change the pivot or another solution suggeted by you? Thanks :)

Khris

Afaik the area is indeed centered around the pivot, the problem is that the character's actual bottom center is not at the bottom of the sprite but above it. (unless it's a sideview game, in which y-based collision doesn't make sense anyway).

The only in-engine solution to this is to set  character.z  to a negative value (it's zero by default); this causes the sprite to be drawn further down. This in turn requires slightly shifting the walkable areas (increasing the area's distance from walls in front of the character, and drawing them closer to back walls).

A nice benefit of doing this is that the character will walk exactly to the spot that was clicked, as opposed to a spot slightly above it.

SMF spam blocked by CleanTalk