# \#Raycast

**URL:** https://forums.unrealengine.com/tag/raycast/917.md

[Latest](https://forums.unrealengine.com/latest.md) · [Categories](https://forums.unrealengine.com/categories.md) · [Tags](https://forums.unrealengine.com/tags.md)

---

## [Making ray cast suspension framerate independent ](https://forums.unrealengine.com/t/making-ray-cast-suspension-framerate-independent/2688640)

<div class="topic-metadata">

**Author:** [@FartMan\_79](https://forums.unrealengine.com/u/FartMan_79)\
**Replies:** 3\
**Last updated:** [January 8, 2026, 9:51pm UTC](https://forums.unrealengine.com/t/making-ray-cast-suspension-framerate-independent/2688640 "2026-01-08T21:51:32Z")

</div>

Hello everyone, I am having a problem trying to get the suspension of my raycast vehicle to stay stable throughout different framerates. Throughout 60-120 FPS, it works completely fine. However, if I run the game at 15 F…

---

## [Water depth footstep sound effects](https://forums.unrealengine.com/t/water-depth-footstep-sound-effects/453063)

<div class="topic-metadata">

**Author:** [@CorsairOfLight](https://forums.unrealengine.com/u/CorsairOfLight)\
**Replies:** 8\
**Last updated:** [August 18, 2025, 10:08pm UTC](https://forums.unrealengine.com/t/water-depth-footstep-sound-effects/453063 "2025-08-18T22:08:05Z")

</div>

Hello all, I am trying to set up a sound effect system for an ocean shoreline, that changes your footstep sound effect based on how deep the water is getting. Now I know that you have to set up line traces and all that,…

---

## [Strange behaviour of Enhanced input - need double clicking insted of single click](https://forums.unrealengine.com/t/strange-behaviour-of-enhanced-input-need-double-clicking-insted-of-single-click/2472746)

<div class="topic-metadata">

**Author:** [@KKJMJ9](https://forums.unrealengine.com/u/KKJMJ9)\
**Replies:** 3\
**Last updated:** [April 25, 2025, 6:00am UTC](https://forums.unrealengine.com/t/strange-behaviour-of-enhanced-input-need-double-clicking-insted-of-single-click/2472746 "2025-04-25T06:00:36Z")

</div>

Hello, I’m getting strange behavior when using Enhanced input to detect pressing or releasing the left mouse button in the inventory. The code below is supposed to make posible for player to drag items in inventory, whe…

---

## [Cascade raycast](https://forums.unrealengine.com/t/cascade-raycast/2453531)

<div class="topic-metadata">

**Author:** [@pyramidal](https://forums.unrealengine.com/u/pyramidal)\
**Replies:** 3\
**Last updated:** [April 18, 2025, 10:31pm UTC](https://forums.unrealengine.com/t/cascade-raycast/2453531 "2025-04-18T22:31:32Z")

</div>

Hi, I would like to code a cascading raycast like this: Source point = position of the emitting object I choose 4 directions (I could have chosen a different number) Four raycasts are generated from this source point…

---

## [Problem with Line Trace/Sphere Trace Fires in All Clients??](https://forums.unrealengine.com/t/problem-with-line-trace-sphere-trace-fires-in-all-clients/2311700)

<div class="topic-metadata">

**Author:** [@RAT\_Official](https://forums.unrealengine.com/u/RAT_Official)\
**Replies:** 1\
**Last updated:** [January 31, 2025, 12:54pm UTC](https://forums.unrealengine.com/t/problem-with-line-trace-sphere-trace-fires-in-all-clients/2311700 "2025-01-31T12:54:39Z")

</div>

Even though, i am running Custom Event “Run on owning Client”… it somehow runs on both other clients and server Somehow, other clients interact with other clients?? i mean in a way : Server : Works normal, only …

---

## [Default physical material BUG on landscape patches](https://forums.unrealengine.com/t/default-physical-material-bug-on-landscape-patches/308088)

<div class="topic-metadata">

**Author:** [@Loxli](https://forums.unrealengine.com/u/Loxli)\
**Replies:** 26\
**Last updated:** [December 16, 2024, 8:15am UTC](https://forums.unrealengine.com/t/default-physical-material-bug-on-landscape-patches/308088 "2024-12-16T08:15:29Z")

</div>

We’re raycasting to get physical material information from the landscape, but we always end up getting a default value from the Hit result of the raycast in both C++ and Blueprint. We can fix the problem one landscape.p…

---

## [Raycast detects a hit when the collider is far away](https://forums.unrealengine.com/t/raycast-detects-a-hit-when-the-collider-is-far-away/1255641)

<div class="topic-metadata">

**Author:** [@Monarch1](https://forums.unrealengine.com/u/Monarch1)\
**Replies:** 1\
**Last updated:** [April 15, 2024, 8:26am UTC](https://forums.unrealengine.com/t/raycast-detects-a-hit-when-the-collider-is-far-away/1255641 "2024-04-15T08:26:34Z")

</div>

I have a ai car road system using the chaos vehicle, using a raycast i check if a car has another car infront of it and if it should stop when the raycast hits, but when i move the camera away from the road system the ca…

---

## [Default Static Mesh Actors do not Update Collision Mesh Origin On Rebase](https://forums.unrealengine.com/t/default-static-mesh-actors-do-not-update-collision-mesh-origin-on-rebase/437394)

<div class="topic-metadata">

**Author:** [@wdisanto](https://forums.unrealengine.com/u/wdisanto)\
**Replies:** 4\
**Last updated:** [March 20, 2024, 4:16pm UTC](https://forums.unrealengine.com/t/default-static-mesh-actors-do-not-update-collision-mesh-origin-on-rebase/437394 "2024-03-20T16:16:06Z")

</div>

When placing static mesh actors in a persistent level at distances ~ 1000 km from the origin I am unable to ray cast after rebasing them to at or near the origin. I’ve tested LineTraceBy and have confirmed they have the…

---

## [Raycast with LineTraceSingle Returns 0 Distance](https://forums.unrealengine.com/t/raycast-with-linetracesingle-returns-0-distance/1339459)

<div class="topic-metadata">

**Author:** [@NightmareGames](https://forums.unrealengine.com/u/NightmareGames)\
**Replies:** 4\
**Last updated:** [October 22, 2023, 10:12pm UTC](https://forums.unrealengine.com/t/raycast-with-linetracesingle-returns-0-distance/1339459 "2023-10-22T22:12:45Z")

</div>

I’m attempting a raycast to find a point of collision, and I’m using LineTraceSingle(). UWorld\* const world = GetWorld(); const TArray\<AActor\*\> actors\_to\_ignore; FHitResult hit; FLinearColor line\_color = FLinearColor(0,…

---

## [How objects ignore the plane in front of them](https://forums.unrealengine.com/t/how-objects-ignore-the-plane-in-front-of-them/1264893)

<div class="topic-metadata">

**Author:** [@isdzaurov](https://forums.unrealengine.com/u/isdzaurov)\
**Replies:** 0\
**Last updated:** [August 18, 2023, 11:53am UTC](https://forums.unrealengine.com/t/how-objects-ignore-the-plane-in-front-of-them/1264893 "2023-08-18T11:53:40Z")

</div>

Hello guys! We are making an interactive game for a multi-touch screen. The game has characters and a green world behind them. We want to implement the mechanics of coloring (the appearance of color from BW) characters…

---

## [2D Rope Swing Behavior AddForce vs SetActorLocation](https://forums.unrealengine.com/t/2d-rope-swing-behavior-addforce-vs-setactorlocation/1226362)

<div class="topic-metadata">

**Author:** [@CoastDav](https://forums.unrealengine.com/u/CoastDav)\
**Replies:** 0\
**Last updated:** [July 11, 2023, 8:50pm UTC](https://forums.unrealengine.com/t/2d-rope-swing-behavior-addforce-vs-setactorlocation/1226362 "2023-07-11T20:50:45Z")

</div>

Hey everyone! I’m trying to create a rope-swing behavior in 2D. Currently what I’ve done is raycast from my player towards the mouse position in world space on the X and Z axes. The blueprint then stores that vector le…

---

## [Measure Brightness of Light on Actor](https://forums.unrealengine.com/t/measure-brightness-of-light-on-actor/461763)

<div class="topic-metadata">

**Author:** [@reedandrader](https://forums.unrealengine.com/u/reedandrader)\
**Replies:** 5\
**Last updated:** [June 18, 2023, 5:42pm UTC](https://forums.unrealengine.com/t/measure-brightness-of-light-on-actor/461763 "2023-06-18T17:42:25Z")

</div>

Hey all, I have a stealth game where I’m trying to measure the amount of light falling on to a character as it moves around a level. First thought was that there might be some sort of blueprint node that would measure …

---

## [Boyancy using world position offset](https://forums.unrealengine.com/t/boyancy-using-world-position-offset/428642)

<div class="topic-metadata">

**Author:** [@Freudian](https://forums.unrealengine.com/u/Freudian)\
**Replies:** 1\
**Last updated:** [May 24, 2023, 11:57pm UTC](https://forums.unrealengine.com/t/boyancy-using-world-position-offset/428642 "2023-05-24T23:57:51Z")

</div>

Hi, I am attempting to pass co-ordinate information to a blueprint class to allow it to bob up and down on water. However, after some searching, I have discovered it not being an easy task. I am currently using World Pos…

---

## [Raycast Skeletal Mesh](https://forums.unrealengine.com/t/raycast-skeletal-mesh/365546)

<div class="topic-metadata">

**Author:** [@JavierRamello](https://forums.unrealengine.com/u/JavierRamello)\
**Replies:** 0\
**Last updated:** [July 29, 2016, 11:45am UTC](https://forums.unrealengine.com/t/raycast-skeletal-mesh/365546 "2016-07-29T11:45:59Z")

</div>

Hello, I have a character with morph targets, and I want to get a point in the mesh surface of the character (after morph modifications) to set IK’s for the hands. I am trying to do this by raycasting from the hands, b…

---

## [Line tracing in screen space](https://forums.unrealengine.com/t/line-tracing-in-screen-space/795581)

<div class="topic-metadata">

**Author:** [@Asterix\_Us](https://forums.unrealengine.com/u/Asterix_Us)\
**Replies:** 8\
**Last updated:** [March 21, 2023, 4:40pm UTC](https://forums.unrealengine.com/t/line-tracing-in-screen-space/795581 "2023-03-21T16:40:45Z")

</div>

Hi! I’m trying to implement an aiming system similar to the one in Weird West (link to provide a more visual example: The Aiming System That Broke Weird West - YouTube, 5:59) The problem I’m having is that I can’t figur…

---

## [Stop raycast from going through wall](https://forums.unrealengine.com/t/stop-raycast-from-going-through-wall/692627)

<div class="topic-metadata">

**Author:** [@Zapking9224](https://forums.unrealengine.com/u/Zapking9224)\
**Replies:** 5\
**Last updated:** [November 19, 2022, 2:21am UTC](https://forums.unrealengine.com/t/stop-raycast-from-going-through-wall/692627 "2022-11-19T02:21:21Z")

</div>

Hi, so I’m trying to make a system where when the player is looking at the skeletons, they freeze in place and when the player looks away, they start moving again. I have everything about their movement working. Just the…

---

## [How to make a line trace ignore and go through actors/props](https://forums.unrealengine.com/t/how-to-make-a-line-trace-ignore-and-go-through-actors-props/682662)

<div class="topic-metadata">

**Author:** [@venomtail](https://forums.unrealengine.com/u/venomtail)\
**Replies:** 1\
**Last updated:** [November 2, 2022, 3:41pm UTC](https://forums.unrealengine.com/t/how-to-make-a-line-trace-ignore-and-go-through-actors-props/682662 "2022-11-02T15:41:50Z")

</div>

I have a line trace that upon hitting, makes a ball move to its location. Problem is that I am having trouble filtering out what I want the line trace to hit and what for it to go through. How do I do that? I have tried…

---

## [Which way is best to Cast to another class?](https://forums.unrealengine.com/t/which-way-is-best-to-cast-to-another-class/600662)

<div class="topic-metadata">

**Author:** [@ShadowSprite123](https://forums.unrealengine.com/u/ShadowSprite123)\
**Replies:** 7\
**Last updated:** [July 10, 2022, 12:18am UTC](https://forums.unrealengine.com/t/which-way-is-best-to-cast-to-another-class/600662 "2022-07-10T00:18:04Z")

</div>

Currently I’ve been wondering if my code is bad and I just wanted the community’s take on it. Which ways are best to Cast to another class and what are the best practices? Currently I’m using this in a raycast function: …

---

## [Why is my raycast hitting the capsule component and not the skeletal mesh?](https://forums.unrealengine.com/t/why-is-my-raycast-hitting-the-capsule-component-and-not-the-skeletal-mesh/599759)

<div class="topic-metadata">

**Author:** [@ShadowSprite123](https://forums.unrealengine.com/u/ShadowSprite123)\
**Replies:** 2\
**Last updated:** [July 9, 2022, 12:27am UTC](https://forums.unrealengine.com/t/why-is-my-raycast-hitting-the-capsule-component-and-not-the-skeletal-mesh/599759 "2022-07-09T00:27:30Z")

</div>

Any ideas on why my raycast is hitting the capsule component and not the skeletal mesh of the enemy even though I have trace complex set to true?

---

## [Why is Surface Type returning NULL?](https://forums.unrealengine.com/t/why-is-surface-type-returning-null/597855)

<div class="topic-metadata">

**Author:** [@ShadowSprite123](https://forums.unrealengine.com/u/ShadowSprite123)\
**Replies:** 15\
**Last updated:** [July 9, 2022, 12:25am UTC](https://forums.unrealengine.com/t/why-is-surface-type-returning-null/597855 "2022-07-09T00:25:58Z")

</div>

So I’ve managed to fix the crash happening with the switch on the Surface Type but now the Surface Type is returning NULL and I don’t know how to fix it. Any Ideas? Player.CPP //Target is the player reference and Hit …

---

## [How to fix Unreal Engine from crashing because switch statement is returning NULL?](https://forums.unrealengine.com/t/how-to-fix-unreal-engine-from-crashing-because-switch-statement-is-returning-null/596682)

<div class="topic-metadata">

**Author:** [@ShadowSprite123](https://forums.unrealengine.com/u/ShadowSprite123)\
**Replies:** 1\
**Last updated:** [July 6, 2022, 10:58am UTC](https://forums.unrealengine.com/t/how-to-fix-unreal-engine-from-crashing-because-switch-statement-is-returning-null/596682 "2022-07-06T10:58:29Z")

</div>

I’ve been trying to do a raycast and seeing what PhysMaterial it hits and doing damage based on the PhysicalMaterial hit on a player but every time I hit the player Unreal Engine crashes as the SurfaceType is returning N…

---

## [Why does Unreal Engine crash when I try to do a switch statement?](https://forums.unrealengine.com/t/why-does-unreal-engine-crash-when-i-try-to-do-a-switch-statement/596546)

<div class="topic-metadata">

**Author:** [@ShadowSprite123](https://forums.unrealengine.com/u/ShadowSprite123)\
**Replies:** 4\
**Last updated:** [July 4, 2022, 8:53am UTC](https://forums.unrealengine.com/t/why-does-unreal-engine-crash-when-i-try-to-do-a-switch-statement/596546 "2022-07-04T08:53:11Z")

</div>

I’ve been trying to do a raycast and seeing what physical material it hits and doing damage based on the physical material hit on a player but every time I hit the player Unreal Engine crashes. Any ideas on how I could …

---

## [How to refer to the health component of a character in C++?](https://forums.unrealengine.com/t/how-to-refer-to-the-health-component-of-a-character-in-c/595974)

<div class="topic-metadata">

**Author:** [@ShadowSprite123](https://forums.unrealengine.com/u/ShadowSprite123)\
**Replies:** 2\
**Last updated:** [July 4, 2022, 7:17am UTC](https://forums.unrealengine.com/t/how-to-refer-to-the-health-component-of-a-character-in-c/595974 "2022-07-04T07:17:46Z")

</div>

How could I refer to the player class’ health value from the health component? Because I tried and it doesn’t seem to work as when I refer to it, it refers to the health component class and not the player class’ health s…

---

## [Raycasting in C++?](https://forums.unrealengine.com/t/raycasting-in-c/595298)

<div class="topic-metadata">

**Author:** [@ShadowSprite123](https://forums.unrealengine.com/u/ShadowSprite123)\
**Replies:** 0\
**Last updated:** [July 2, 2022, 2:04am UTC](https://forums.unrealengine.com/t/raycasting-in-c/595298 "2022-07-02T02:04:54Z")

</div>

Hi! I don’t know if I’m doing this somewhat right or if I’m completely wrong but I wanted to know how I should go about this: 1.Should I shoot the raycast from the player class and just attach the gun. 2.Or should I im…

---

## [Actors Not Receiving Point Damage from Line Trace](https://forums.unrealengine.com/t/actors-not-receiving-point-damage-from-line-trace/576604)

<div class="topic-metadata">

**Author:** [@GV-Rafael-III](https://forums.unrealengine.com/u/GV-Rafael-III)\
**Replies:** 1\
**Last updated:** [June 8, 2022, 3:47am UTC](https://forums.unrealengine.com/t/actors-not-receiving-point-damage-from-line-trace/576604 "2022-06-08T03:47:19Z")

</div>

For a shooter project, I created a health component to place on the player and enemy actors. I bound events for the component’s owner receiving point and radial damage within the component itself: GetOwner()-\>OnTakePoi…

---

## [How to change Decal's rotation at runtime relative to the floor or wall? C++](https://forums.unrealengine.com/t/how-to-change-decals-rotation-at-runtime-relative-to-the-floor-or-wall-c/511014)

<div class="topic-metadata">

**Author:** [@Quaked54](https://forums.unrealengine.com/u/Quaked54)\
**Replies:** 28\
**Last updated:** [April 19, 2022, 12:07am UTC](https://forums.unrealengine.com/t/how-to-change-decals-rotation-at-runtime-relative-to-the-floor-or-wall-c/511014 "2022-04-19T00:07:10Z")

</div>

I have done this before successfully and for some reason the decal will not spawn anymore. I have the correct collision channels ticked I also created my own specific collision channel for the linetrace that is going to …

---

## [Can't linetrace for custom channels?](https://forums.unrealengine.com/t/cant-linetrace-for-custom-channels/509273)

<div class="topic-metadata">

**Author:** [@Shadowsora](https://forums.unrealengine.com/u/Shadowsora)\
**Replies:** 0\
**Last updated:** [March 23, 2022, 8:24pm UTC](https://forums.unrealengine.com/t/cant-linetrace-for-custom-channels/509273 "2022-03-23T20:24:55Z")

</div>

So I made a custom channel called interactable, and in blueprint it seems to trace just fine, and return true when collided with. However doing so in C++ does not allow for it to be checked. Here’s my code, blueprint tha…

---

## [Is it possible to do a spline trace?](https://forums.unrealengine.com/t/is-it-possible-to-do-a-spline-trace/507774)

<div class="topic-metadata">

**Author:** [@anonymous\_user\_d66254ed1](https://forums.unrealengine.com/u/anonymous_user_d66254ed1)\
**Replies:** 1\
**Last updated:** [March 18, 2022, 4:12pm UTC](https://forums.unrealengine.com/t/is-it-possible-to-do-a-spline-trace/507774 "2022-03-18T16:12:48Z")

</div>

Like the title states I want to do a line trace but rather than a straight line I want to go along a curved path. Right now I am using sphere trace at multiple points on a spline but would have more consistent results if…

---

## [Adding gravity to linetrace vectors](https://forums.unrealengine.com/t/adding-gravity-to-linetrace-vectors/488701)

<div class="topic-metadata">

**Author:** [@TynnyriBarrelson](https://forums.unrealengine.com/u/TynnyriBarrelson)\
**Replies:** 0\
**Last updated:** [September 12, 2021, 7:19pm UTC](https://forums.unrealengine.com/t/adding-gravity-to-linetrace-vectors/488701 "2021-09-12T19:19:01Z")

</div>

Okay, so I’ve been struggling with this line of code for longer than I care to admit. Whenever this loop is executed, it should move the raycast endpoint down. That should allow me to do a quick linetrace with “gravity” …

---

## [Need Help Creating A Blood Spray Effect For My Game](https://forums.unrealengine.com/t/need-help-creating-a-blood-spray-effect-for-my-game/487079)

<div class="topic-metadata">

**Author:** [@Cat419](https://forums.unrealengine.com/u/Cat419)\
**Replies:** 3\
**Last updated:** [August 6, 2021, 4:54pm UTC](https://forums.unrealengine.com/t/need-help-creating-a-blood-spray-effect-for-my-game/487079 "2021-08-06T16:54:13Z")

</div>

Hi Everyone! I am creating a game and need some desperate help with something. I need to create a blood spray effect that will occur when the enemy takes damage. The way I need this to work is as follows: The player…

[Next page](https://forums.unrealengine.com/tag/raycast/917.md?match_all_tags=true&page=1&tags%5B%5D=Raycast)
