cancel
Showing results for 
Search instead for 
Did you mean: 

Character Collider

mpaul0055
Honored Guest
Hi Guys

Im struggling to get my character controller to interact with other colliders. I have a Horse asset that i have running towards my main character, and i idealy want him to get knocked out to the way as the horse runs into him.

I have a Capsule Collider around the horse, and have tried it with rigid bodies on the capsule and the character controller, but the horse just runs straight through the character.

I could animate it, but i would prefer it to be physics based as the character could be in any number of positions.

Im obviously doing something wrong and any pointers would be great.

Fingers crossed my Demo will be up on the usual rift sites by next wednesday!
3 REPLIES 3

CaliberMengsk
Explorer
Character controllers are not effected by physics, except for gravity. They might get stopped by something, but they don't have a way to have forces (like addforce or objects hitting them) to be applied.

The only way to get around this is to not use a character controller, and write a custom script for controlling movement and collisions using a rigid body. It's a bit scary to do at first, but it's a much better method as it uses less resources, and gives you more control.

molton
Explorer
I have no idea if it would work, but maybe you could make the character controller a child object of an invisible cube around the player controller that could react to the collisions from the horse. I guess the cube would need a collider and a rigidbody with a transparent shader on it.

mpaul0055
Honored Guest
Cheers guys!

If i can get our idea to work molten I'll be 😄 Seems logical as I only need the collider aspect of the rigid body. Although thinking out loud the child object may not be able to override the character controllers position.

I may disable the character controller when the horse hits the player for a few seconds while they get pushed out the way!

Will let you know how I get on!!