Support Forum

Stop character controller movement on collision to AI entity

I’m trying to make it so that when I collide into a AI Entity the players character controller either stops or slows down.

Currently the AIEntity just gets pushed back from the character controller.

How are you supposed to properly handle this case?

Edit* I’m curious if the intended use of the RVOCharacterController is to use that instead of Unitys default?

Hi

This very much depends on how you want them to slow down. What effect are you looking for?
Should the agent try to avoid the player? Or should it just slow down because it needs some time to recover after the impact or something?

I’m trying to mimic that of games like Silent Hill and Resident Evil.

Primarily I need the agent to be able to not get pushed when my character walks into them. It should just block player movement (or if it needs to be pushed much slower, almost acting a force on the player.)

As for slowing down after impact, sure that’s also something that’d be useful. Such as a knock-back or just simply slowing down after being shot (tho I feel like this can be done just by slowing the agent down)

I aploigize for the bump. I’m curious does the default Unity CharacterController not the right approach? Am I supposed to use the built in one for AStar?

Hi

The default Unity character controller should work out of the box I think? Iirc it will not allow other character controllers to push it around. You should not add a rigidbody to the object.