Cant spheretrace/linetrace any spawned (at runtime) Actors

So I am building an inventory system and therefore I want to have the possibility to drop items. I do that by deleting the item from my inventory and spawning something like a little chest with spawn actor by class. If I want to interact with that little chest, I normally would do a spheretrace by channel and then check, if the hitted target implements the right interface. But the problem ist, the spheretrace does not hit the chest. It just goes right through there. I tried putting that actor on the map in the editor, and there the spheretrace works. Has anybody an idea why this problem occurs? :frowning:

You would have to check the spawned chest’s collision settings. Does it have the trace channel set to block or overlap? If it’s set to ignore, then it will be ignored by the trace.

You’d also have to be sure that the trace is happening on a channel like visibility or a custom channel, that the reaction would also not need to be ignored on the chest.

Please pause the game once you spawn a chest

  • select the chest
  • go to it’s details panel
  • make a screenshot showing the trace reactions in the collision settings.

The trace is in visibility channel. Thanks for answering so quickly :smiley:

single trace with object type filter

or multi test:

You might just be hitting another object on the single trace?? (only object type filter can help limit the amount of traced objects)

multi test video in action

Alternatively you could make a custom trace channel called interactables and have a custom check only on that trace channel

Both of your solutions didnt work for me… I think the problem is not, that I hit another object or whatever first. The problem is no matter what I do, I cannot hit the spawned actor. Maybe I am spawning the actor wrong? I am using all of this for a multiplayer game, so maybe a replication issue?

Here I have the ondrop in my UI.

I know that i am getting the playerlocation 2 time for the same thing, gonna change that when everything is working… And since I am new, I cannot put more than 1 picture in a post, so there will be 2 more…

Maybe instead of doing a double bool check, just print the name of the hit actor.
Are you sure you remembered to add the interact interface to the chest? Maybe the compounded bool is giving you wrong information.

Try just a print string and see if it hits the chest.
I’m getting a hit if I recreate your the code

The chest was dynamically spawned into the level

I already tried printig the hit actor, but it only prints something with “landscape…”. The Interface is also implemented, because I can interact with an actor I placed in the world.

I solved the issue… The problem was, I had the event that spawns the actor in my UI. Now I placed it in my Character and call it from the UI. That was the little mistake :expressionless_face:

Anyway thanks for the help. I appreciate it :smiley: