Bug with spawning bullet

My code was working fine not long ago, and I haven’t changed anything, but now I’m getting an error that prevents my bullet from spawning?

Damage it set to 10 by default - do it that way since I have a few ‘surprises’ for players

Edit:
This is also where the bullets spawn

I can’t tell you exactly what’s wrong but just following the bread crumbs of the error it appears that by time you get to the “IgnoreActorWhenMoving” node, the spawned bullet has been destroyed making the spawned bullet reference null. As good practice you should be checking to make sure the return of the spawn call actually spawned your actor with the IsValid node.

Now, why is the actor not spawning is a different question. I suspect it’s related to collisions and/or overlaps on spawn. If I were debugging this, I would take it down to the basics, disconnecting all hit collision detection and just see if I can get the bullet to spawn then start adding functionality back in.

EDIT:
Just noticed that on ActorBeginOverlap, you’re doing some casting and ultimately calling destroy actor if it’s not what you’re expecting…put a print in after the last cast failed but before the call to destroy and see if that’s what is causing the problem. Like I said, I think you’re colliding with something on spawn and destroying it just as quickly. Heck, just disconnect the call to destroy and see if your bullet now spawns.

Well I’m not sure what I did but it works perfectly fine now??? I don’t even know anymore, if it works it works

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.