Raytracing and PrimitiveComponents

Hi there,

does anybody know how I could interact with a trigger by raytracing instead of Component Overlap Events? I want to change my Itemsystem from Overlapevents to Raytracing because the overlaps don’t work well if multiple items are placed in a shelf or some food or ingredients are placed on a table.

Here a screenshot of an pickable item.

So far the raytrace only fires an event once it hit the visible component (ItemMesh) but it don’t react to the SphereComponent at all. Is it because the SphereComponent has no Collision?

I’ve set the collision response and hoped for a result, but it still works only on the visible mesh…This is not the best solution since the game is a 3rdPerson RPG and there is no crosshair HUD planned to help you focus an smaller actor like a key or similar with a raytrace, therefore I need the TriggerComponent.

I’ve set the collision response like that in the BaseItem class

The raycast is performed in the PlayerCharacter class every frame

The costumchannel works, but as I said…only on the visible component

Is there a way or workaround to interact with triggers by raycasting?

Nevermind…Setting the CollisionResponse to ECR_Block fixed the problem…now everything works as intended.

I didn’t use ECR_Block so far because I wasn’t sure if it will make the PrimitiveComponent act like a collider and I’ll have tons of floating object…but as it looks it will only affect the raytrace…perfect