x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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.

Product Version: Not Selected
Tags:
more ▼

asked Dec 11 '14 at 12:56 AM in Blueprint Scripting

avatar image

ShrewGlue
444 99 84 108

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

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

more ▼

answered Dec 11 '14 at 01:57 AM

avatar image

joeGraf STAFF
1.5k 35 12 69

avatar image ShrewGlue Dec 11 '14 at 01:59 AM

"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. "

Thank you! Is there a tutorial for this anywhere?

avatar image joeGraf STAFF Dec 11 '14 at 02:28 AM

That's too specific a usage case for a tutorial. The steps are pretty straight forward, though.

avatar image ShrewGlue Dec 11 '14 at 02:34 AM

Alright. But just the line sphere check, I can't seem to create it.

What nodes should I use?

avatar image Sir Quizalot Oct 10 '16 at 08:24 PM

By line sphere check, do you mean MultiSphere Trace for Objects?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

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)

more ▼

answered Dec 11 '14 at 03:05 PM

avatar image

joeGraf STAFF
1.5k 35 12 69

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question