I’m trying to make a zombie cross a window.
I’m using an animation montage with root motion enabled, but the collision of the capsule component is not letting the animation finish.
If I don’t use root motion, the capsule component is left behind.
How should I make it so the zombie can cross the window along with his capsule component so my character’s bullets don’t go through him?
There’s probably a better way to do it, but you could set/re-set the capsule size of the character temporarily when your character is going through the window, something like:
Granted the values are for the default character, but you could set them for your character as well. Also, I’m doing it by button press, but you could set it to occur when the anim montage starts of your character going through the window.
If you look at crouch it uses a bool to check for when crouched and then does what Wes Bunn is showing you. So you could put in a bool check with this as a function and then make the bool true when using the window enter animation and then false when in the walk animation.
Thank you, I was able to do it by changing the capsule size as you said =).
I ran into a problem though, since the capsule is the root component, the zombie was going underground when I changed the size of the capsule because of gravity. So what I had to do is change the zombie movement mode to flying at the start of the animation, then back to walking at the end.
The changes are made using an Animation Notify State:
Our issue was that we are using Root Motion animation in Level Sequences and because the Actors are bumping into the surrounding environment, it made the actual animation in game different from the preview animation in Level Sequencer. To get around this, we set the Movement Mode to Flying, but resizing the CollisionCapsule would not work because it would resize the Actors as well (since CollisionCapsule is the root component). Instead, we left CollisionEnabled = 3 (which means that the collision for the capsule is enabled for Hit events), then we cheated by setting WorldStatic and WorldDynamic layers to Ignore. This is procedurally set before and after playing a cutscene.