How to check if a pawn is partially overlapped
Hello, I would like to know if there is a way to check if an object is partially overlapped (or a component).
For example, if 50% or more of the item is not overlapped, then play a sound.
asked Dec 11 '14 at 12:56 AM in Blueprint Scripting
Overlap checks just tell you if they are overlapping at all. To check penetration depth, see if two objects overlap, then follow that with a line sphere check where the line is the vector between the objects' centers and the sphere is the radius of the object that you'll play a sound if encroached upon. If the magnitude of that line is >= 50% the radius of the object's sphere, then you play your sound
answered Dec 11 '14 at 01:57 AM
I thought the FMath functions to do this were exposed to Blueprints. Looks like they aren't. However, the math you need is pretty easy.
Make a vector OriginA - OriginB. Get the magnitude of that vector. Compare the collision radius to the value you use to determine whether to play the sound. (Radius * 0.4 or whatever your overlap amount is)
answered Dec 11 '14 at 03:05 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here