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 do I make an OverlapMulti()'s FCollisionShape visible?

How do I make an OverlapMulti()'s FCollisionShape visible?

I do not mean detect visible channel, I mean to make the shape itself visible while testing in the editor.

This would be very useful for debugging purposes, is it possible?

Product Version: Not Selected
more ▼

asked Mar 22 '15 at 12:34 PM in C++ Programming

avatar image

423 47 55 77

avatar image Pierdek Mar 22 '15 at 08:00 PM
 static FName KickOverlap(TEXT("KickOverlap"));
 FCollisionQueryParams Params(KickOverlap, false, this);
 GetWorld()->DebugDrawTraceTag = KickOverlap;

Then use overlap or something, the engine will draw shapes/lines.

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

1 answer: sort voted first

I usually just manually draw the shape with one of the following:

  • DrawDebugBox

  • DrawDebugCapsule

  • etc


 // Doing my collision check
 const FVector extent(newWidth * 0.5f, newWidth * 0.5f, newHeight * 0.5f);
 GetWorld()->OverlapAnyTestByObjectType(newLoc, FQuat::Identity, colObjQueryParams, FCollisionShape::MakeCapsule(extent), colQueryParams)
 // Draw a debug shape using the collision params
 DrawDebugCapsule(GetWorld(), newLoc, extent.Z, extent.X, FQuat::Identity, FLinearColor::Green, -1.0f)

more ▼

answered Mar 22 '15 at 07:57 PM

avatar image

2.6k 95 41 111

avatar image Erdrik Mar 22 '15 at 09:41 PM

Thanks I got it to draw, but how do make it not permanent?

EDIT: Nvm found it. FlushPersistentDebugLines() Thanks again. :D

avatar image staticvoidlol Mar 23 '15 at 06:30 AM

Ah nice - I didn't know about FlushPersistentDebugLines().

Another option is to pass in a value for display time when calling DrawDebugCapsule(). It is the last param in the signature. I think values smaller than or equal to zero is seen as persistent.

(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