# OnTriggerEnter() without rigidbody?

I know this is an old question and it has been answered for a lot of people. Unfortunately none of the solutions apply to the problem I seem to have with rigidbodies.

I have a moving AI character and the playermodel. When the AI gets to close the player just bumps on top of it. If I unattach the rigidbody from the moving AI this does not seem to be a problem. My player is controlled by a charactercontroller and the rigidbody is set to "Is Kinematic".

Of course, when none of the agents has a rigidbody my entire combat mechanic falls apart. Does anyone have any idea on how to solve this?

For clarity, here is a short demonstration of the bug: Bump

And the code in question:

void FixedUpdate ()
{
if (!controller.isGrounded)
{
movement.y -= gravity * Time.deltaTime;
}
controller.Move (movement * Time.deltaTime);
}

void CalcMovement (float h, float v)
{
movement = new Vector3 ();

if (v != 0 || h != 0) {
movement = v * forward + h * right;
movementDirection = movement.normalized;
}
}

• Are you sure your player is Kinematic? and still bumping? BTW, why you player is Is Kinematic enabled? I'm sure if it is not, then at least AI can push you little bit. And can you explain what are you doing OnCollisionEnter? Dec 25, 2015 at 16:19
• @HamzaHasan The player does not have the rigidbody, that is Kinematic, it's the other character. Yes I'm sure it is enabled. When I searched on the web, this was always the solution that seemed to work... not for me... I'm using OnCollisionenter with the weapons, and have them deal damage when they hit a specified target. Dec 25, 2015 at 16:39
• I hope you are using Capsule colliders. Right? Dec 25, 2015 at 16:42
• Yes, all the colliders are capsule colliders. For the weapons as well as the characters. Dec 25, 2015 at 17:20
• Have you tried to 'play' with Slope Limit (Limits the collider to only climb slopes that are less steep (in degrees) than the indicated value.) and Step Offset of char controller? docs.unity3d.com/Manual/class-CharacterController.html Dec 28, 2015 at 8:35

You can have a try to remove the rigid body from your player. A Character Controller component contains rigid body and Collider
• In the gif you upload ,your player can be affected by gravity.But if the player do not attached the rigid body, he wouldn't affected by gravity anymore~And what is the other character?your AI robot? Dec 28, 2015 at 9:40