Projectile to Projectile hit detection.

Hi all, I’m hoping someone can help me, as I’ve spent a number of days on this issue and I’m no further forward. (I’m new to blueprints and I’m not a programmer)

I’m making a clay shooting game and I’m having a problem passing the recorded hit variable to the HUD. Most of the tutorials I’ve seen, that cover hit detection, cover hits to characters rather than targets, and certainly not a destructible projectile used as a target.

I’m not sure if I’m casting to the wrong blueprint, or whether I’m using an incorrect method. Even if I had the right BP, I don’t know which wildcard to use. I’ve tried a number of things before asking for help. Images attached.

Any ideas.

If it only works sometimes, that makes me think maybe there’s a parameter in your Projectile Movement component that needs to be tweaked. I think by default it only checks collision every X frames (I think it calls them “steps” in the parameter but I could be wrong). In any case, I think you may need to tweak this value to increase the precision with your projectiles. It may have a dramatic impact on performance with multiple projectiles but hopefully you don’t encounter that issue. And I’m also hoping I’m right about that parameter because I may not be remembering right…

Thanks Chumble. I’ll take a look at that now and report back.

I tweaked both the Max Simulation Time Step and Max Simulation Iterations to no avail. Some times the hit is immediately displayed. Other times it shows numerous hits at once.

Hmmm, weird that it would show numerous hits. Makes me think something else is going on here. Is this a multiplayer setup by any chance? If not, the first thing I might to do to clean it up is immediately disable collision when a “valid” collision is detected so at least you’ll only ever get one collision.

Secondly … are you saying they always register a hit now? When you say it was “to no avail” it sounds like it didn’t change anything but your next sentence seems to indicate the problem is now having multiple collisions (instead of sporadically none).

Result! A step in the right direction. Disabling the collision after the initial hit has stopped throwing out multiple values. It still occasionally fails to register hits, with no immediately apparent pattern. What I mean is that the clay breaks on being hit with the gun’s projectile, but the ClayHit value sometimes isn’t print to screen.
I’ll go back and try tweaking the Time Step and Iterations values again.

Cheers for your help Chumble.

When you say the clay breaks, are you using a “Destroy Actor” node on it? I wonder if it’s possible that you’re destroying the clay before the colliding projectile has a chance to read all the values from it. One tactic I’ve used is to disable collision and set the actor to not be visible and this will effectively “destroy” the actor (as far as the player sees) but you can still access the values from it… then Destroy it when you’re done. That might not be the issue though

I didn’t use the destroy actor node, as the particle emmitter for the dust puff and the impact sound don’t work when I destroy actor.

So I just had to deal with a similar issue myself. Even when modifying the simulation rates, my projectiles were still just passing through objects. I ended up not using the projectile’s collision at all and instead running a line trace at regular intervals between the projectile’s previous location and its current location. When the line trace returns a result, I stop the projectile and use that result as the hit object.

Sorry for the delayed respose. I’ve been on a number of different forums looking for a solution. I missed your post. Your solution sounds more complex than it probably is. (I haven’t worked with line trace yet)

My problem was due to the incompatibility between physics objects and the projectile movement component. I removed the PMC and created a separate launcher to throw the target. Collisions and hit detection are all working flawlessly now.
This issue has been a blessing in disguise, as I was forced to add my own functionality to the launcher, and now have complete control of the launch variables for each target. I even have a remote control, to change the elevation and rotation of the launcher.