How to set Can Jump to true when the bottom of pawn hits an object?


HI My game is Using a pawn class acter that is a Cube. I’m using event hit to set a variable call Can jump. I like if Can Jump to be set If the bottom of the cube hits and not the other sides.

If your objects are flat, you can use Hit Normal and compare it against Vector(0,0,1). You can use Dot Product to do that. If the result is around 1, it means you’re hit from below.

If your objects are not flat, do the same but with difference in location:

P.S. I mixed up the vector in Subtract. You need to Subtract Hit Location for Actor Location, or else your Dot Product will be negative.

I Just use a line trace