Sway back and forth on ledge/dropoff

You can use a line trace or collision check in front of the player to see if there is a ground there.
It there is none and player is not running play the sway animation.

If you have a more linear game you can also make an actor with overlapping volume and place it around the edge.
Walking into the volume will tell the pawn to play the animation.

Is it possible to make your character sway back and forth. Before he falls off the ledge. I want him to not fall off the ledge play animation with a delay. If the player persist to push in that direction. Then the character will fall off the ledge. I’m fairly new to Unreal Engine. "In 3ed person"But have been working on this for about two weeks now. Any help would be great. Thanks!

Thanks for the quick reply. I am not sure that would work in my case. In the picture below i have tile floor plates that will disappear when hit by a disk. I am not sure how i can get the sway to work with my animations going at the same time. Hope this might help understand what i am trying to do. Thanks!

I am still working on this issue. I just want my character to sway back and forth like in the game Mickey Mouse Castle of illusions. When you stand too close to an ledge. The problem I’m having is my floor plates will be disappearing also. I just need it to trigger the animation when you get too close to an ledge. Note that you also must be able to jump over the holes in the floor. With jump animation. Thanks.