Help spawning Projectile

Hello All,

Im trying to make a robot vehicle with a gun on it that fires at the player when the player at (or near) the center of the AI’s field of view. Currently I have an robot vehicle(RV) that roams until the player is spotted then the RV move to the player. Just a basic AI set up. furthermore upon creation of the RV when the game is run it spawns a random weapon (Gun1 (An Actor class and there is only weapon in the game so far)) mounted to it. I’ve been trying to figure out how to spawn the projectile(which is also an Actor Class) at a scene component just in front of the barrel. Here is my BP set up on the weapon(Gun1). my plan was to make the perseption angle very small but IDK if that will work.

Any help would be appreciated.

Hi, if you’re having difficulty getting the projectile to move, you can add a Projectile Movement Component to your projectile blueprint. You can then specify its Initial Velocity (along X if that’s the forward direction) and the projectile should go off on its own without any added impulse.

But if it’s not spawning at all, the projectile might be colliding with the weapon/vehicle collision and getting destroyed instantaneously. So try moving the scene component further away from the weapon and vehicle. Adding a print string to the projectile’s event tick will also help you know if it’s alive.

Thanks for the response. I have tried to move the scene component, still no joy. I also have a projectile movement component in the Projectile BP, still nothing. I have a debuging print string on the projectile BP also which never appears in game. Attached are my BPs that lead (Or are susposed to) the spawning of a projectile. First is the AI Controller, then the Robot Charactor. Next is the Gun1 Actor BP and finialy the Projectile Actor BP. if there is an easier/better solution im all ears.

Thanks Again