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.
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.
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
Thank you! Is there a tutorial for this anywhere?
That’s too specific a usage case for a tutorial. The steps are pretty straight forward, though.
Alright. But just the line sphere check, I can’t seem to create it.
What nodes should I use?
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)
By line sphere check, do you mean MultiSphere Trace for Objects?