Justin Dupre'
Justin Dupre'

Reputation: 41

How to fix animations causing model to ignore physics/collision

enter image description hereProblem: Imported model with Rigidbody and (later added) capsule collider ignores physics and collision with terrain, while other models with colliders work as intended.

Summary: I'm working with the robot kyle model/rigging free asset from the unity asset store. I added an animator controller with idle, walk, run, and jump animations and a simple script for movement. No custom physics scripts attached. I have a ball in the scene with a sphere collider and it works as intended with terrain collision and gravity and projectile motion.

Edit: I discovered that deleting my animator controller entirely and deactivating the animator in the inspector causes the model to fall onto the terrain as intended on play (only works with added capsule collider on), but turning back on the animator (with only an idle animation in the new animation controller) causes the model to float while doing the idle animation.

Upvotes: 0

Views: 1757

Answers (1)

Seung-Heon Lee
Seung-Heon Lee

Reputation: 11

You should make sure that movement is conducted via the rigidbody component and not by the transform component:

rb.MovePosition(transform.position + transform.forward * Time.deltaTime);

Upvotes: 1

Related Questions