How do I make bullets that split into more bullets?

0 favourites
  • 5 posts
From the Asset Store
This pack contains 10 types of bullet effects, with different shapes and colors.
  • So I may making a bullet-dodging game and I have enemies that are supposed to shoot bullets that after about a second split into more bullets, but there is an issue.

    So my code summed up is that when the enemy spawns the bullet instance, it then sets the bullets angle and a instance variable called splitTimer. When splitTimer reaches 0, the bullet slows down and then spawns smaller normal bullets in 6 directions (0, 60, 120, etc).

    The issue is that when the bullets split, all of them go the same direction, and that direction is always the same as the splitting Bullet, and I have no idea why. My guess is that when I am using Bullet > Set Angle > X degrees, it's changing all bullets and not one, so how can I fix this?

    Thanks

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I promise this one will be chaotic & put your cpu into stress: dropbox.com/s/tc9v75lb6xizh86/bullet_ascendant.capx

  • Angle is different to the bullet Angle of motion, although they can affect each other if the Set Angle option is ticked on the behaviour. If that all looks correct then check where you set the angle, it must be in the action immediately after the spawn object action so they remain picked correctly.

  • Angle is different to the bullet Angle of motion

    I know, I meant angle of motion instead of set angle. I do have the set angle of motion action right after the spawn bullet action, so I still don't know.

    It could potentially be because the enemies spawn multiple of the splitting bullets at once, so maybe one is triggering all of them?

  • If they are the same object as the original bullet then any other general gameplay events will affect them so you'll have to check. Do you have an event that tells the enemy bullet to go somewhere like towards the player? If not can you share a screenshot of the bullet splitting event.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)