Collision rule with charactercontroller
Collision rule with charactercontroller
I'm trying to do a 'protective shield' for my character so i created a box over him. The problem is that the character somehow 'teleports' up on to the box when it is created. I've also added the collisionrules for both the character's body and support with the shield but it seems like it has something to do with the way the support works. Are there any ways to make it ignore the shield?
Re: Collision rule with charactercontroller
If you're using the SimpleCharacterController, it doesn't use the body's rules to prune its supports. You can, however, choose to filter based on collision rules by modifying the code in the FindSupport method.
Re: Collision rule with charactercontroller
would that be modifying this line ?
if (candidate.CollisionRules.Personal >= CollisionRule.NoSolver)
i'm not exactly sure how the find support works but my guess is to add another condition?
if (candidate.CollisionRules.Personal >= CollisionRule.NoSolver)
i'm not exactly sure how the find support works but my guess is to add another condition?
Re: Collision rule with charactercontroller
oh sorry, now the character doesn't teleport up to the box. but the camera sort of zooms in right into the character as if being confined to the bounding box. Is that still something to do with the find support?
-edit-
I figured it out, it was the camera's problem cause its determined using raycast. Thanks! Another question, what is an appropriate way to remove an entity from space? I'm using space.remove and sometimes the game crashes saying unable to remove nullexception. This happens when my fireball hits both the ground and another bounding box at the same time
-edit-
I figured it out, it was the camera's problem cause its determined using raycast. Thanks! Another question, what is an appropriate way to remove an entity from space? I'm using space.remove and sometimes the game crashes saying unable to remove nullexception. This happens when my fireball hits both the ground and another bounding box at the same time
Re: Collision rule with charactercontroller
Space.Remove is the proper way to do it, but it sounds like you might be removing from within an immediate event (one with a present-tense, '-ing' name). That is unsupported and will corrupt the state of the engine.Thanks! Another question, what is an appropriate way to remove an entity from space? I'm using space.remove and sometimes the game crashes saying unable to remove nullexception. This happens when my fireball hits both the ground and another bounding box at the same time
Removing entities was also disallowed from deferred events in v0.15.2, but is supported in the development version (http://bepuphysics.codeplex.com/SourceC ... evelopment).