Find Collision UV node doesn't work

Hello,

I think I’ve done everything as described in the release notes - “Support UV From Hit Results” is set in Project Settings. I use LineTraceByChannel to get Hit Result Structure. The hit is registered, but UV vector is not. Am I doing something wrong?

1 Like

No idea, i’ve done the same, and it only returns (0,0) no matter what :frowning: I’ve checked the actor im hitting has UV’s in the channel 0 i set it to. Still nothing. Anyone have ideas to what we’re missing?

One thing though, is that i’ve noticed that the Return Value from “Find collision UV” returns false. So apparently it can’t find the UV hit, but why not? The box im hitting is just one of the standard Static Mesh boxes in the 1st Person Example project.

Lol, setting Trace to Complex helped… Not sure it’s necessary, but now it returns actual UV coords.

2 Likes

I’m with you. Even with Trace Complex enabled, the Return Value of Find Collision UV is returning false, and the UVs are 0,0.

And yo did restart your editor after enabling support uv from hit?

Now it works. Maybe because I restarted the editor since enabling Support UV From Hit Results in Project Settings.

based on testing so far, two thing need to be considered.

  1. use lineTraceingbyObjects with custom collistion filter
  2. create line tracing and find collistion UV from line tracing source not from target
    ( my case, add on event graph on characterBP, not the collision meshBP )
    By this condition met, the find UV works as advertised. I am not sure it is bug or designed to be working this way.

I had the same problem setting Trace Complex to true helped.

I just finished struggling with this and since this is the first result in google for “ue4 find collision uv” I’ll add my 2 cents.

My problem was that I had set the mesh to “use simple collision as complex” setting it back to the default of “simple and complex” fixed my issue.

So here’s my theory on how this works: the node uses the UV mapping of the mesh to determine where the UV collision happened, but to do this the input hit from a line trace must hit the actual mesh and not a simplified hitbox, since my hitbox had no UV mapping it simply gave 0,0.

It might be possible to copy the UV mapping of the mesh onto the hitbox so that any hit on the hitbox does give a somewhat accurate response, but that would require fiddling with blender for me and I only need the UV collision very rarely.

Take with a big grain of salt since I’ve not seen the actual code for the node.

For me I had to set the static mesh (which i want to paint on) collision complexity to “simple and complex” and collision preset to “overlap all”.

This helped, but that’s insane that this solution works :d

For those who stuck with this on C++ side, make sure FCollisionQueryParams for line trace params has those 2:
QueryPrams.bTraceComplex = true;
QueryPrams.bReturnFaceIndex = true;

4 Likes

For C++ users: In the FCollisionQueryParams, bReturnFaceIndex must also be true.

	FCollisionQueryParams QueryParams;
	QueryParams.bTraceComplex = true;
	QueryParams.bReturnFaceIndex = true;
5 Likes

Thanks, you just saved my day!

thanks it works

1 Like

Does not work on skeletal meshes
thread

1 Like

How can “Find Collision UV” be used with the Hit result from an Event Hit? It returns 0,0 every time. why does this function require complex tracing (whatever that is) and how can that be turned on for hit events?

Thanks Kiry, you just saved my life!

The project I worked on on my laptop showed the same problem on my computer. Fortunately, I set TraceComplex to true and solved it, but I don’t know why. Is it because the UV of the flat static mesh is different? No, UV moved from simple to complex, but the results didn’t change.
Do you have any idea?

Super specific solution but in case you’ve fiddled around with the project settings like I once did, make sure this setting stays unchecked, otherwise you get 0.0, 0.0.