Search code examples
game-physicsphysicsunreal-engine4unreal-blueprint

How to differentiate between a hit event and a friction hit event in UE4?


I am working on a game in VR and I'm trying to differentiate between a hit event where the user is essentially throwing an object and a friction hit event where the user is dragging or pushing the object against another one. I'm having a little bit of trouble because after going through all of the different variables of the hit event the only variable that seems to hold any sort of help is the Normal Impulse all of the others seem to be equal to one another regardless if it is a friction hit or a throwing hit.

Which essentially helps me to weed out the super weak hit events but it is still not much help. Has anyone else had any luck trying to do something like this?

I thought maybe velocity of the actor would be able to help but, that doesn't seem to work by itself. I feel like there must be some other factor that I haven't considered yet in order to determine this.

This check needs to occur in an OnHit event:

Example OnHit event


Solution

  • With @Ruzihm's help I was able to create a solution. I created two threshold variables for the magnitude of the hit event so that I could have greater control over what constitutes as an event I want to capture.

    Hit

    (If you are wondering about the IsHeld function then take a look at the VRExpansion Plugin. It's free and does a lot of the heavy lifting stuff for you in VR)