I use the CollisionHandlerPusher to slide my characters when they collide with walls. No problem. The wall is only an into object and the player is only a from.
The problem arises when I try to collide my characters with each other. If I still use the pusher and set the characters to be both from and into object, then when my player collides with one, it will drag that character. I don’t want that, I want only him to slide in that case.
What to do in this kind of situation? CollisionHandlerEvent might be an option, but no idea how to reimplement the pusher effect with my changes.
If you meant pushing, then I’m not surprised that characters can push each other. Indeed, from an implementation point of view, you need the system to be symmetrical.
If two characters are running full speed into each other, then both are pushed away to solve the collision.
Likewise, when one character moves and the other stands still, both are still pushed away.
To have one character only react to the collision would lead to the question: which one? The first one processed by the code ? That would make the order kind of random and arbitrary. The fastest one ? The collision system deals with positions only, not speed.
hey, I’m the one asking questions
But if seriously, I’m not sure why you are asking me how that would work. I don’t know, I’m asking myself.
Not sure if I understand you right, but when a character (into) object collides with a wall, they are both colliding. Just because the wall didn’t move doesn’t mean it didn’t “react to collision”. So I’m not asking how to make only one react to collision, because that wouldn’t do anything. I’m asking how to prevent them both from being both from and into when they collide with each other, I guess.
How? Well, that’s what I’m asking. But obviously there is some solution, looking at existing videogames.
Oh sorry! These questions were not meant to you. They were general. I just have the habit, when facing a software problem of any kind, to wonder how I would have implemented it if I had to do it myself. So, if I had implemented Panda’s pusher, I would have made sure that its behavior was symmetrical. I am not sure that Panda is implemented that way, but it may be because that would explain the behavior you’re observing.
Just to make sure I follow you: you have two characters, A and B. When should A be pushed away, and when should B be pushed away, when Panda detects that A and B are overlapping?