- Home /
Question about pushing objects, "Animate Physics" and Rigidbodies
Is there a way to control the "animate physics" on the animation component?
To put it simply, I have a relatively large enemy with multiple colliders representing the body parts (made them all have kinematic rigidbodies so that the animate physics option works) that pushes an object (I tried many different combinations of character controllers and rigidbodies but I did not find a good solution), a player with a non-kinematic rigidbody, during its animations. One animation is a walk animation where the tail moves from left to right and back.
The issue is that no matter what settings I use for the kinematic rigidbodies and physics materials on the enemy, and non-kinematic rigidbody and physics materials on the player, there is no change in effect. The tail "hits" the player too hard where the tail should just be brushing, or "carrying", the player character aside it
I have no issue with using character controllers, or any kind of other setups but I couldn't make it work anyway, using "Animate Physics", with the setup I described in the first paragraph, was the closest to the desired behavior that I achieved so far (without it on, the tail does not push the player as hard but a lot of glitches occur such as the tail sometimes throwing the player below the floor, making the player "jump" if the tail colliders are too close to the floor, and more. I assume this is because without the animate physics the colliders are just changing transform.positon according to the animation so the colliders probably sometimes appear within the player collider, at fast speeds, and force it into weird directions).
I could probably find a better example but this was something I found quicker http://www.youtube.com/watch?v=NYL8K2kIGfk&t=59
When the player character blocks in that video, he is not hit but the tail brushes him or pushes him back. That is the behavior I want to emulate but can't seem to do.
I'll try anything if it works, I'm not set on using Animate Physics or anything else. I did try experimenting with triggers (since without rigidbodies collisions don't work) and a charactercontroller (since it won't move unless you tell it to) but it didn't work out very well, I had buggy and choppy movements on top of it not working anyway.
I'm having a similar issue but with a simple door animation and a charactercontroller. While the door is in opening or closing animation state, the player is passing through the door if the player is in the way...I found some solution, but they create other issue. If you have found a way to affect rigidbody with an animation can you say me how you did xD.
Ok I just read this. "On the other hand, if you want your player character to be affected by physics then you might be better off using a Rigidbody ins$$anonymous$$d of the Character Controller."
Your answer
Follow this Question
Related Questions
Keeping rigidbody upright in relation to slope 2 Answers
Collisions with an animated character 1 Answer
Stopping animation affecting physics 0 Answers
Animation causes rigidbody to move 0 Answers