Why isn't my hit being detected?

https://youtu.be/yqcmOfzkW7s

Here’s a video, turn down the sound the cannon is a bit annoying.

The ship has a large capsule for collision:

and uses the ‘Event Any Damage’ node for transferring damage data.

The CannonBall also uses the ‘Apply Damage’ node for applying damage to the detected actor:

The ball tracks the actor currently so it cannot miss while I’m testing this.

The issue is the ball and ship do not make any kind of hit detection beyond a distance, yet once the ship gets closer it works perfectly fine.

I can’t figure out why this is happening.

It sounds like the issue happens because the projectile skips over the ship when it’s farther away, likely due to frame-based collision updates. Try enabling continuous collision detection (CCD) on the CannonBall, and make sure the collision channels for both the ball and the ship are compatible and set to block each other. That should ensure hit detection remains consistent at any distance.

1 Like

Hey, thank you. I’ve tried this just now and made a video:

It’s showing what happens in slomo, I just can’t understand it. I checked and I think the sphere collision, which is the parent of the ball mesh, is moving with the mesh as expected. The sphere trace is huge, and detects a nearby ship to home in onto. You can see in the print strings that it successfully detects and targets. But the home in part doesn’t happen, and neither does the hit. But when the ship is close like in the above example, it works fine. The sphere trace actually uses the collision mesh which is parented to the cannonball mesh component as the central location to radiate from. So the collision is definitely there

also welcome to the community haha :slight_smile:

I have also ensure that the actor itself is moving too. It’s not just the collision mesh and mesh component that are moving while the actor is stationary. It’s all moving together

…this is driving me crazy I just can’t find anything relevant to this issue at all lol

Please anyone, I’m so stuck here I have no idea why hits don’t work :frowning: It’s nothing to do with collision channels or anything

Wow ok I’ve just figured it out…

I don’t understand why but, once the ship is close hits seem to work fine, if the ship is far then hits don’t work.

It’s the ship collision. I needed to tell it set collision on query and physics rather than just query…

I just can’t wrap my head around this one.

It makes sense I guess, the cannonball is the child of a sphere collision which simulates physics so I guess the ships collision also needs to just have physics collision on too so it can ‘feel’ hits from physics objects.

But why did it work in close range then?

Anyway it’s fixed now :slight_smile: I can get on with my night lmao

Edit: I know why it only worked close range now: My cannonballs parent collision sphere does not simulate physics instantly. I tell it to simulate after the thruster and projectile movement activation which means there must be a half second of time or something until physics is enabled after it gets spawned. So in between that, in even slo.mo speed mode, it must be getting detected as a non-physics hits so my ship doesn’t need to handle physics collisions.