How do I check what is colliding with me using event tick

Is there a way to get unreal engine to tell me what is currently colliding with my actor in a way that I can use it every couple of event ticks?

Literally, every other frame.

Note that this is somewhat costly; any reason why you cannot stick with start / end overlap and keep overlapping stuff in an array to use it elsewhere?

1 Like

Does overlapping also work as soon as you touch the solid object?

No. Overlap is an overlap / block is block (Hit Event):

You get to choose with a lot of granularity which and how components handle collision with specific object types; and how they respond to tracing. More channels / objects types can be added. Consider:

How do you get what is currently hitting you, every few event tick?

As above, Event Hit will trigger every time there is collision. There’s generally no need to use Tick for that, unless you’re doing something unorthodox. Are you?

Getting Hit is a reactive thing, you do not query every couple frames whether you’re being hit but instead react to receiving a hit. The question suggest you might be approaching things from an odd angle. If in doubt, consider explaining what the end goal is. The answer may be out there.

So when I get a hit I divide my cube into 8 pieces and then divide each of those cubes into 8 pieces depending on which ones have been hit, after that any cubes that are still being collided with from that point on are deleted. The thing is the hit collisions don’t update when the new mini-er cubes are created.

Not entirely clear what is going on judging by this description but Event Hit is where I’d start:

after that any cubes that are still being collided with from that point on are deleted

How to handle that would depend how you’ve structured it. Perhaps the cubes you’ve divided should handle their own Hit Events and delete themselves?

should I upload a screenshot of my code and an example of what happens, to make it easier to understand the description?

Ideally, yes. But a clear, step-by-step may be needed. At least something along the lines of:

  • a cube actor gets hit with a line trace / physics sim
  • the cube actor is destroyed and replaced with 4 smaller actor cubes
  • if any of the small cubes gets hit, they are destroyed, too

That’s what I got. I might have gotten it all wrong, ofc :innocent: Hence the dire need for clarity.

And unsolve the question so people do not ignore it.

It says the question is unsolved on my side,

that is the blueprint code for it ^^^^^^

^^^ This is example of what happens currently, I have to re walk into the block multiple times for it to process the collisions, where as I want it all to be processed in one go.

Is there better clarity now?

Not really. Still not sure how you want it to work, you never actually explained. We see script with functionality in functions whose purpose is unknown.

  • are we supposed to touch the cube once and it all crumbles into the smallest bits? And everything gets destroyed in one go? Is that it?

One thing that immediately jumps out, though, is the order of execution. You Destroy the actor first and then expect it to execute extra script. While this may work now, it’s generally unsafe.

I want it to be a destructible octree.
Where when you collide with it, it will subdivide the cube into 8 parts and repeat that process to a certain level based on based on which cubes are still being hit.;

Is there is a while being hit event or how to make a while being hit event? I believe thats the only reason it isn’t working is because the on hit event is called once, and I need to have a slight delay or unreal engine says infinite loop detected, the small delay means the smaller cubes miss the hit event I think.

There is not. Propagate the hit the original cube received and process it inside the newly spawned actors. Expose (instance editable) variables on spawn, so you can pipe in the depth of how granular things should get, when to stop subdividng.

Thanks, I’ll mark it as solved soon. But should I just mark your original post showing the currently overlapping event as the answer?

That’s up to you. Ideally, you’d now post how you made it all work, show off a little and accept that as the answer :innocent: