How can I get a line trace to hit an invisible sphere collider?

Right now I’m using LineTraceByChannel to extend out from the center of the camera to a pre-determined distance. I’m using this as part of an interaction system. I’ve got it reporting static meshes, things like floors and platforms, but what I’d like is for it to recognize the invisible sphere colliders surrounding certain actors - things like weapons, or buttons - so that the player doesn’t necessarily need to hover EXACTLY over the actor to see that it’s interactive. I’d like to have some kind of sphere or box collider around them that the line trace will hit, but the collider itself doesn’t affect the actual actor’s position or movement.

edit your colliders collision presets to ignore all the object responses and set block visibility in the trace responses only.

1 Like

Hello! I did something similar, and JoeyPark’s advice looks like a solution to your problem. Since the discussion is still ongoing, I decided to describe it in more detail:

  1. Create a Blueprint Class (actor).
  2. In editor add Collision Sphere (or anything you want) to the actor, and set the size that you want.
  3. Add mesh for it. In my project it looks like this:

    For mesh I set this collision properties

    For Sphere Collision this:

In my project it works like this:
Trace collide the sphere
image
Character can go throught the Sphere and Mesh
image

If you want to collide with mesh, you can left collision settings for mesh by default (BlockAllDynamic)
Hope it helps.)

1 Like