I am following the UnrealGaimeDev Skill System tutorial. I am watching this video: [Eng] Ability/Skill Tree System: Creating Magic Missile Spells #18 - YouTube to create a homing missile spell. In the video he creates a spell actor that homes to a target enemy. The spell actor has an On Hit Component for the collision sphere that is supposed to trigger against the collision capsule of the enemy character.
For some reason my On Hit Component event is not triggering. Somehow the spell actor is passing through the enemy collision capsule and actually pushing the enemy character around. Eventually it triggers. Sometimes it triggers when it should. Itâs not easily predictable. Iâm at a loss.
I have tried many different combination of settings on both the spell actor and the enemy character. The current config is detailed below:
The projectile just keeps pushing the enemy character around. I donât believe this is a code issue, because I put a debug point in the On Component Hit (Sphere) in the BP_MagicProjectile event and it never triggers.
Iâve been working on this for several days and I have read several other posts here and elsewhere with people having similar issues. Iâve read their resolutions and none seem to have worked for me.
I would appreciate any help getting this to work! Let me know if you have any questions. Thank you.
I checked the Generate Overlap Event on both components, then I switched the Collision Response on the BP_MagicProjectile from blocking Pawn to overlap Pawn as suggested.
According to the video tutorial I believe you have to set the channels to âblockâ or it wonât work. Now when I cast the spell the projectile just passes through to the center of the Enemy actor and stays there generating no event at all (see video)
I have one additional piece of information that may help. Sometimes the event does trigger. It seems to trigger when the projectile traps the enemy between itself and another object that canât be moved. I reverted the collision channels to the original config and took the video below.
Occasionally it even fires right away like I intended it to, but I canât figure out what makes it work sometimes and not other times.
I could switch to an Overlap Event system and work around this issue, but Iâm stubborn and I want to learn.
I donât understand exactly what the documentation means by âsolidâ, does this just mean collision channel = blocked? Is there something else I need to do to make sure my enemy character collision capsule is âsolidâ?
Hi there,
Can you show the function check collision to see how it was setup? Also, can you add print string on component hit node, âother componentâ + get display name + print string, to check if something other than the enemy capsule is being hit ( when it works)?
I did all his tutorials years ago, and donât recall any collision issues in that particlar chapter. He uses homing projectile logic, so he checks simulate hit events as true, is homing projectile as true, collision is set to block all dynamic, with includes pawns. Also, homing projectile target requires the arrow component from the enemy BP.
By looking at the screenshot, the branch condition is true only if hit actor is equal to selected target actor. So, isolating your issue, either other actor is null ( which youâve already tested as always master enemy bp), or target actor is somehow different from other actor.
I would recheck collision settings and print strings for the target actor value, homing projectile settings and all outputs from hit event.
I originally had the arrow component, but in troubleshooting this over the last several days Iâve experimented with some other options. Currently I switched to just setting the homing target to the capsule component. As you can see from the video, it seems to be homing properly.
I know what youâre thinking: there may be a logical error in the function where the actors donât match and it just skips over destroying the actor. I can confirm that is not happening. I set a breakpoint on Check Collision function entry point and the event just never triggers.
I did print the values just before entering the CheckCollision
The print statements are all correct, getting to the print statements is the problem
I also added print statements for the enemy and projectile spawn to check to see if the collisions were messed up on spawn.
which prints âI am a ECC_WorldDynamic and I ECR_Block Pawnsâ
What constitutes a âhitâ event? Is the âhitâ event basically the same as the begin overlap event? Should this thing be triggering when the collision cylinder from the enemy and collision sphere from the projectile begin to overlap? Is it when the sphere is completely inside the cylinder?
You can see from the videos that the projectile sphere passes through the collision cylinder. Shouldnât my settings make that impossible? I have the enemy cylinder set to block world dynamic (same type as my projectile) and I have my projectile collision sphere set to block pawn (same type as the collision cylinder for the enemy). I think answering the question why the projectile sphere is able to pass through the enemy cylinder is the answer.
Thatâs a very good question. Iâll see if I can reproduce the projectile hit logic and share here if I found anything.
Have you checked the final project for download? Usually the link is shared in the last video of his series. That is also something Iâd check, if converting this project to UE5 generated any issues with physics collisions.
I actually didnât know he released the final project. Iâll check the final video and see if I can figure anything out from that.
Normally when I have some sort of issue I check the comments. There was one comment that had the same issue from a massive time span (someone from 3 years back, and someone from 1 year back) You can see the comment below:
This is why I say Iâm stubborn. I want to learn why this isnât working to better understand how the engine works. This person just switched to a begin overlap event, which Iâve used many times before with a lot of success.
I do have one deviation from his tutorial series. As you may have noted, I have a top down character not a third person character. I doubt it, but is it possible that might affect anything?
Any advice on which to use when and why? IIRC the UE documentation suggested the overlap âfor example a player walking into a triggerâ. It seems like the âon hitâ makes sense for projectile collisions and on overlap would be good for spawn triggers and such.
My plan was to finish up this tutorial series and use it for the basis of a multiplayer VR game. I wanted to go through the work of adapting a system I know to see the differences in SP vs MP and traditional vs VR.
EDIT:
I got to look at his project. His works no problem. Low and behold⌠He also changes his missile spell to use overlap instead of hit⌠Maybe he covers this in another video, or discovered issues later? I guess Iâll finish watching the series and move on.
Perhaps he did figure out a better way using o overlaps. Hit events also make sense, for instance, for a grenade that explodes on impact. Perhaps it is a combination of factors leading to random failures. Iâll keep a tab on this. Glad to know you are moving on. Keep up the good work.