Can you disable collision of the capsule for certain animations?

I need my character to walk through a static mesh but only during one animation. Does anyone know if this can be done?

There are many ways and one of it is through AnimNotifies.

Below is an example where the Pawn’s capsule collision gets disables at the start of Running animation and gets restored at the end of the animation:

  1. Create AnimNotifies you’ll be adding logic later on the specific animation you want.

  1. Open AnimBP and modify Pawn’s capsule collision via AnimNotify events

  1. Add LaunchCharacter node after disabling the collision to force the collision check.

Please be noted that the caveat of this approach is when you cancel the animation to the point that the AnimNotify won’t be triggered. So make sure to either don’t let the player cancel the animation or you can trigger it on another way (i.e. upon transitioning to other animation)

EDIT: Added #3 above to force collision-check.

Hi many thanks for the advise but the collision is still on. here is my setup

This is a bit weird but it works. After you disabled the collision, add “LaunchCharacter” with Z value of +0.0001 or -0.0001. This will force your character to recalculate the collision and make him pass through objects.

Ok i’ll give it a try, what do I use for the target in launch character?

Do I need to change the collision setting on the static mesh I want to pass through?

Your character.

Just the capsule collision. You might want to test the Disable collision first without reenabling it yet. Then if you see that it works, you can add back enabling your collision again.

Still no joy. set up is this

Any ideas?

the is valids were connected so just ignore that on the photo

Unconnect your “collision on” event first to see if the collision off works. What is the animation name you are trying to disable your collision?

its just a mixamo animation although after adding a root bone I renamed it “entry_please_god” as been trying to get it to work for a while hahaha.
Yeah just disabled the collision on and still not working

Ok so here’s how I did it in my end. See if this works on you.

My animation is Dash with root motion. Meaning, the animation drives the character’s movement dashing forward so I didn’t need to do the LaunchCharacter node.

[YouTube video of Collision Off/On in action][1]

Below is my Dash animation with root motion:

Then below is my AnimBP that disables and re-enables my collision. They are carefully timed so they are not too short (which might ignore the disabling of collision) nor too far (which too long enough the player will fall through floor). I set the Movement Mode to Flying so my Character will ignore the gravity and avoid falling through floor, but still able to pass through objects due to having no collision. Also note that SetActorEnableCollision has similar result with SetCollisionEnabled. Its just neater not to get the CapsuleComponent node and pass it to SetCollisionEnabled.

Your a genius thanks a lot, works great now when I put the movement mode into flying. Thanks for all your help

Please don’t forget to mark as answer if it helped you. Thanks and good luck to your game.