When AI takes cover behind a rigidbody, the rigidbody sliiides.

Howdy,
okay this is weird. I'm banging together a system where ai will take cover behind dynamic objects, much like how in halo when cover gets knocked around ai will still understand that it's useable in a new location, so that means some rigidbodies. However, when my dude slides up against the wall, he puuushes the wall, in what i presume is the held movement direction pushing up against the physics body. Mass on the ridigbody doesn't matter. When i do it it just spins forever, even if i'm not pressing buttons.

If i set the depth further out so they arne't really touching the object, it works fine. however given that there's no setup in the demo like thi si i don't know i fyou know it does this. I'm not 100% sure what i'd want out of this comment, maybe a toggle or some way to make it _not_ do that? or at least common things to look out for. just thought i'd let you know, it's weird and kinda funny.

also like, when i try to go into the cover and the cover is tipped over it uhmm... flips me and then does whatever the fuck happened there. i know this isn';t strictly how the system is _meant_ to be used, but i figured you should see that anyway.

 
When the character takes cover their collider is disabled on the character controller side of things so their back can get closer to the wall than what the regular capsule collider provides. Because you are using a rigidbody that collision is causing the object to move. One way to solve this would be to completely disable the collider, or temporarily make the rigidbody kinematic.
 
that's a fair point, i usually let the weapons hit the subcharacter stuff instead of the main colldier so it's not like that'd be a problem. yeah i figured it had to do with the collision disabling getting it wedged in there. i'll try some of those methods out. i'd prefer to keep the cover non kinamtic but ig uess there's nothing stopping me from having it kin when being used, and if shot with enough force to enable the gravbity again and manually apply the force. it's roundabout but it might work.

Much appreciated, i'll give that a go.
 
Top