The Crushing Boulder

i’m trying to make a crushing boulder to smash some of my monsters with, but I don’t want them to get crushed if they walk/run into it, just if it rolls or falls on them. Using Mass x Velocity won’t work, as they will run into the unmoving boulder and still take damage.

I believe I need some method to tell if the monster’s forward direction is opposite of the bolder and only inflict death if they don’t line up. I thought I could subtract the forward vectors, but that didn’t do anything useful. Maybe if I knew the movement angle of both?

I need the computer to:
“Only allow damage in forward movement direction of the Boulder”

Maybe not exactly what you need but could you do something where you check if the boulder is moving and only apply damage then? (that way if they run into an unmoving boulder it won’t hurt them) With that you could even do different amounts of damage based on the boulders velocity or something if you wanted.

I have something similar to that, where I calculate the mass times velocity, but because it doesn’t take in account direction, if my AI are running fast enough, they can smash themselves on an unmoving boulder, or one even rolling away from them. Direction is the key, albeit a key I have yet to figure out.

You know, between this and the inability to have proper impact sound effects, UE4 seems really primitive at times. I can’t drop a rock on a monster’s head, or even the floor, with proper damage and sound effects applied. You really couldn’t ask for more basic and highly usable functions.