No announcement yet.

Traces fail on perpoly SkeletalMesh using MasterPoseComponent

  • Filter
  • Time
  • Show
Clear All
new posts

    [PROGRAMMING] Traces fail on perpoly SkeletalMesh using MasterPoseComponent


    I posted this on answerhub but my posts there usually go ignored so maybe I can get some traction here.

    I have a modular character composed of a Head and a Body mesh. the head is the 'main' mesh and the body is another component that uses the head as its MasterPoseComponent to sync animations (I set this on my character's BeginPlay function in cpp)

    I'm trying to perform Traces against the character, for which I've set the meshes to collide per poly (which I absolutely need for what I'm doing).

    The problem is the traces only work against the animated pose of the head, but completely fail to hit the animated pose of the body (and can only trace at the position of the default unanimated A-Pose of the character).

    I did some investigation and narrowed it down to the use of a second mesh component with MasterPoseComponent. Using the same body mesh as a separate SkeletalMeshActor with animation traces properly.

    Here's the visual proof, with debug lines that show the trace and debug sphere/diamond to show the trace hits.

    Trace against my character, correctly hitting the head mesh (hit is a bit inside the neck because of animation but its there)
    Click image for larger version

Name:	78285-tracehead.png
Views:	1
Size:	674.7 KB
ID:	1171958

    Trace against my character, completely going through the hand and failing to hit:
    Click image for larger version

Name:	78284-tracebody1.png
Views:	1
Size:	136.6 KB
ID:	1171959

    Trace against my character, hitting the arm where it would be if it were in the default unanimated A-Pose:
    Click image for larger version

Name:	78286-tracebody2.png
Views:	1
Size:	692.8 KB
ID:	1171960

    Trace against a SkeletalMeshActor with only the body mesh, correctly hitting the hand in its animated position:
    Click image for larger version

Name:	78287-tracebody3.png
Views:	1
Size:	380.7 KB
ID:	1171961

    The only related post I found is this, and I can't even see this property called 'Skip Simulating Bones' to even try (and I suspect that one was related to PhAT bodies anyway)

    My traces come from cpp code, and I'm using LineTraceSingleByChannel. but I also tried SweepSingleByChannel, LineTraceMultiByChannel and skelMeshComp->LineTraceComponent, and the results are always the same.

    did anyone else come across this?

    Follow me on Twitter!
    Developer of Elium - Prison Escape
    Local Image-Based Lighting for UE4