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"

Could I get some help in understanding (FName(TEXT("HUDClick")), this);?


I am testing the function LineTraceSingle

Mostly I cannot understand this part of the code.

     FCollisionQueryParams TraceParams(FName(TEXT("HUDClick")), this);
     //TraceParams.bTraceComplex = true;
     //TraceParams.bTraceAsyncScene = true;
     TraceParams.bReturnPhysicalMaterial = false;

What does (FName(TEXT("HUDClick")), this); do here?

And I got error when I used this part.

1>D:\ue4\New folder\MyProject\Source\MyProject\MyProjectHUD.cpp(41): error C2220: warning treated as error - no 'object' file generated 1>D:\ue4\New folder\MyProject\Source\MyProject\MyProjectHUD.cpp(41): warning C4800: 'AMyProjectHUD *const ' : forcing value to bool 'true' or 'false' (performance warning)

But when I removed it, I didn't get any error when I used this..

 FCollisionQueryParams TraceParams;//(FName(TEXT("HUDClick")), this);
     //TraceParams.bTraceComplex = true;
     //TraceParams.bTraceAsyncScene = true;
     TraceParams.bReturnPhysicalMaterial = false;
     //Re-initialize hit info
     FHitResult TraceHit = FHitResult(ForceInit);

So what exactly is that part and what does it do?

Product Version: Not Selected
more ▼

asked May 07 '14 at 01:43 PM in C++ Programming

avatar image

433 77 118 149

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

1 answer: sort voted first

It's calling the constructor of FCollisionQueryParams with an FName and a pointer, however I think you're missing a parameter (hence the warning about converting an AActor* to a bool).

This is the signature of the constructor I think you're trying to call:

 FCollisionQueryParams(FName InTraceTag, bool bInTraceComplex=false, const AActor* InIgnoreActor=NULL)

You probably want:

 FCollisionQueryParams TraceParams(FName(TEXT("HUDClick")), false, this);
more ▼

answered May 07 '14 at 01:47 PM

avatar image

Jamie Dale STAFF
7.5k 177 67 305

avatar image envenger May 07 '14 at 02:00 PM

Ok.. The documentation is showing a 404 error..

So how any other way to know how the constructor works?

avatar image Jamie Dale STAFF May 07 '14 at 02:09 PM

Even if you're not using the GitHub source, you will at least have access to the header files to be able to use UE4, so if you're using Visual Studio, pressing F12 (Alt+G if you also have Visual Assist) should take you to the declaration of a type/function.

(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