Projectile not spawning

I added the exact code as given in the github commit. But when I press play, the projectiles are not being fired from the tank as well as from the turret. There is no error in the code. It is compiling successfully.
I am adding some screenshots, please have a look at them.

Would you mind showing the ProjectileSpawnPoint in the view port? I suspect you have it in an incorrect position.

Yes. Here it is.

Could you try moving it further away?


To be clear I meant moving the spawn point further away from the mesh to avoid it potentially not spawning due to colliding with it.

And I suppose that didn’t help?

Not sure then, would you mind sending me your project using the following link?

Please use File > Package Project > Zip Up Project within Unreal as this will ensure only required files are zipped up and things like the Binaries are excluded.

ok i’m sending you.

I’ve sent you my project.

Cool. I’ve downloaded it just now and will take a look at it after dinner.

Thanks in advance, Dan. :smiley:

  1. You don’t have a Fire action mapping in your project settings
  2. Your turret is missing an argument for the timer
GetWorld()->GetTimerManager().SetTimer(FireRateTimerHandle, this, &APawnTurret::CheckFireCondition, FireRate, true);
// --->                                                                                              ^ missing

Which means you were using true for the fire rate which would implicitly convert to a float value of 1 and you don’t loop as false is the default argument for loop.

It worked. Thank you Dan. :smiley:

1 Like

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

Privacy & Terms