I have this blueprint issue where for some reason, i simply cant get kill actor to work on any of my blueprints. I currently have a project with a tank that can shoot projectiles, the blueprint is “EventHit”>“Delay”>“Kill Actor”, inside the projectile’s blueprint script, it has target self. It litterally does nothing. I have the same issue when I tried to code a Pawn switch, since i got 2 diffrent tanks. Kill Actor simply does nothing D:
Here i made a video regarding the multiple issues, kinda threw in this “scaling issue” i had when trying to spawn more actors… weird stuff
Ok, I suspect your event Hit isn’t firing. There are so many little caveats with it. Try hitting F9 with the delay selected to place a breakpoint and play again, if the blueprint doesn’t pause the game, it’s not firing. Some things to check. The event hit only fires when the root object makes a collision, so if your collision object is the box collision, you need to use OnComponentHit instead. Secondly, make sure you have “generate hit events” enabled on the object you want to collide, it’s off by default. Lastly, make sure your object has valid collision settings.
So there is couple of bug with your code actally and i assume your game is single player game…
Projectile:
Destroy actor should be called only with self. You connected otherActor to Destroy actor which means you try to destroy other actor not the projectile
try to add breakingpoint or print string debug to make sure your collision event get called… and print out the name what was hit
Scaling Issue
Your tank root component scaled down as i saw… but when you spawn the tank you supply transform from playercontroller which contains 1,1,1 scale… so actually your tankpawns root component would be scaled back to 1,1,1
Try to keep root component scale 1,1,1 and downscale everything else or do different tanks in modelling program
Other Issue what i saw
At input event when you unpossess from tank you call DestroyActor again without any input… that means you try to destroy player controller dont destroy that… if you wanna destroy the tank what was possesssed try to getpawn and destroy that pawn… you must do that before unpossess because after unpossess you will not have valid pawn
I had i similar issue today.
seams for some reason i cant Destroy actor from outiside its Blueprint.
really odd, i dont remenber this being a issue before.
Anyway, i just created a custom event inside the actor, so i can call that Event to destroy the actor inside its own blueprint.