Problem with changing physics groups
Posted: Wed Jan 13, 2016 12:29 am
I'm having a problem with switching physics groups quickly.
I'm working on a game where the point is to stay on a platform. By default, the Cylinder entity of a character has a CollisionGroup that collides with the boundary plane's StaticMesh, keeping him safe from falling if he runs towards the edge. He can only get hit off if another character's attack sends him flying, in which case the Cylinder's CollisionGroup is changed to a group that doesn't collide with the boundary.
The problem is that if a character is hit by an attack while his physics penetrate the boundary at all, the added velocity from the attack is negated and the character doesn't move. I'm assuming this is because I'm switching the player's physics group and then adding the velocity in the same frame, before the Space can update? Is there a way to fix that, or should I always wait a frame after changing the physics group to add the velocity?
I'm working on a game where the point is to stay on a platform. By default, the Cylinder entity of a character has a CollisionGroup that collides with the boundary plane's StaticMesh, keeping him safe from falling if he runs towards the edge. He can only get hit off if another character's attack sends him flying, in which case the Cylinder's CollisionGroup is changed to a group that doesn't collide with the boundary.
The problem is that if a character is hit by an attack while his physics penetrate the boundary at all, the added velocity from the attack is negated and the character doesn't move. I'm assuming this is because I'm switching the player's physics group and then adding the velocity in the same frame, before the Space can update? Is there a way to fix that, or should I always wait a frame after changing the physics group to add the velocity?