Cancelling the solver when detecting collision
Posted: Mon Nov 24, 2014 5:38 am
Hi,
I just implemented pickups in my game using a sphere entity (with locked rotation), so they can tumble to the ground when dispensed, bump into other inert objects, etc. The pickups handle the Sphere's InitialCollisionDetected event, during which they check to see if the colliding object is a player and if so, give the player their gameplay effect. After the Space Update is completed where the pickup was used, it is despawned.
A player typically runs straight through the pickup, so they experience a little bump when they collide with it. No surprise, it has some mass and it is being pushed away by the player. In practice though, this is unpleasant and I'd like to remove that hiccup.
Is it possible to avoid running the solver for a collision from the InitialCollisionDetected event handler? I tried setting the pair.CollisionRule or the sender.Entity.CollisionInformation.CollisionRules to NoSolver, but that didn't seem to work.
I just implemented pickups in my game using a sphere entity (with locked rotation), so they can tumble to the ground when dispensed, bump into other inert objects, etc. The pickups handle the Sphere's InitialCollisionDetected event, during which they check to see if the colliding object is a player and if so, give the player their gameplay effect. After the Space Update is completed where the pickup was used, it is despawned.
A player typically runs straight through the pickup, so they experience a little bump when they collide with it. No surprise, it has some mass and it is being pushed away by the player. In practice though, this is unpleasant and I'd like to remove that hiccup.
Is it possible to avoid running the solver for a collision from the InitialCollisionDetected event handler? I tried setting the pair.CollisionRule or the sender.Entity.CollisionInformation.CollisionRules to NoSolver, but that didn't seem to work.