Announcement

Collapse
No announcement yet.

Help spawning Projectile

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    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.

    Click image for larger version

Name:	spawnProjectileBP.PNG
Views:	798
Size:	160.0 KB
ID:	1662148
    Last edited by Moist_Plasma; 09-08-2019, 12:52 AM.

    #2
    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.

    Click image for larger version

Name:	PROJ.jpg
Views:	644
Size:	374.7 KB
ID:	1662182

    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.
    Unreal Possibilities
    Wave Spawning System | Tower Defense Starter Kit | Grid Creation Systems

    Comment


      #3
      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 Click image for larger version

Name:	RobotAI_BP.PNG
Views:	703
Size:	250.9 KB
ID:	1662305Click image for larger version

Name:	Robot_Cha_BP.PNG
Views:	667
Size:	255.9 KB
ID:	1662306Click image for larger version

Name:	Gun1_BP.PNG
Views:	652
Size:	299.0 KB
ID:	1662307Click image for larger version

Name:	projectile_BP.PNG
Views:	660
Size:	231.9 KB
ID:	1662308

      Comment

      Working...
      X