# Possible to Line Trace on Mesh Deformation?

**URL:** <https://forums.unrealengine.com/t/possible-to-line-trace-on-mesh-deformation/2092494>\
**Category:** Community & Industry Discussion\
**Tags:** unreal-engine, question\
**Created:** [October 28, 2024, 2:26pm UTC](https://forums.unrealengine.com/t/possible-to-line-trace-on-mesh-deformation/2092494 "2024-10-28T14:26:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TristanAVR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TristanAVR](https://forums.unrealengine.com/u/TristanAVR)\
**Post date:** [October 28, 2024, 2:26pm UTC](https://forums.unrealengine.com/t/possible-to-line-trace-on-mesh-deformation/2092494/1 "2024-10-28T14:26:42Z")

</div>

I have a mesh with blendshapes as a SkeletalMesh in Unreal and I want to line trace on the mesh itself but I noticed that I am not able to dynamically update the collider on this mesh based on the deformation, is there a way I can line trace directly on to the mesh instead of on its collider?

I am currently trying to get the vertex data myself and using my own line intersection on each individual triangle check if it hits anything. Would this be way to go?

---

<div class="post-metadata">

**Author:** ![TristanAVR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TristanAVR](https://forums.unrealengine.com/u/TristanAVR)\
**Post date:** [November 1, 2024, 2:59am UTC](https://forums.unrealengine.com/t/possible-to-line-trace-on-mesh-deformation/2092494/2 "2024-11-01T02:59:42Z")

</div>

To specify on the mesh deformation. We are using morph targets to deform the mesh but the mesh itself contains no bones.

---

<div class="post-metadata">

**Author:** ![SupportiveEntity](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@SupportiveEntity](https://forums.unrealengine.com/u/SupportiveEntity)\
**Post date:** [November 1, 2024, 7:08am UTC](https://forums.unrealengine.com/t/possible-to-line-trace-on-mesh-deformation/2092494/3 "2024-11-01T07:08:16Z")

</div>

Hey there @TristanAVR! Welcome to the community! So you won’t be able use pure collisions for checking the morph target hits. Though if I remember correctly, you could check your vertex positions, as I do believe their movement is actually read when MTs are active.

Here’s a thread showing off how to get the SKM vertex positions with some custom code:

> [@Getting the world position of skeletal mesh vertex](https://forums.unrealengine.com/t/getting-the-world-position-of-skeletal-mesh-vertex/386765/32):
>
> Got it working in 5.4 #include "Rendering/SkeletalMeshRenderData.h" #include "Engine/SkeletalMesh.h" #include "SkeletalRenderPublic.h" bool UCustomBP\_Library::BP\_GetSkeletalMeshVertexLocations(USkeletalMeshComponent\* Mesh, TArray\<FVector\>& Locations, int32 LODIndex) { if (!Mesh || !Mesh-\>GetSkeletalMeshAsset()) { return false; } const FSkeletalMeshRenderData\* RenderData = Mesh-\>GetSkeletalMeshRenderData(); if (!RenderData) { return false; } c…

Hope this helps! Let me know how it goes, I’m interested in the outcome!

---

<div class="post-metadata">

**Author:** ![TristanAVR](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@TristanAVR](https://forums.unrealengine.com/u/TristanAVR)\
**Post date:** [December 17, 2024, 7:46am UTC](https://forums.unrealengine.com/t/possible-to-line-trace-on-mesh-deformation/2092494/4 "2024-12-17T07:46:26Z")

</div>

From what I can tell this does not get the vertex data of the applied morph target at runtime.

What the mesh looks like with the morph target set to 0:

 ![UnrealEditor_iApeVCTR8T](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/3/b/b3ba6f1433f09e36ffa27ccc6ab3d1ff19f907a4.png)

What the mesh looks like with the morph target set to 1 and the vertex data retrieved from “ComputeSkinnedPositions”

 ![UnrealEditor_GFBzc4F49G](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/7/d/07d943793205cbc353d1d5b9c602d15ced0f9ed5.png)

I would expect it to show the deformations so I am not really sure what’s wrong here
