How do I fix my turrets from randomly shooting 2 bullets?

0 favourites
  • 7 posts
From the Asset Store
Shoot balls to destroy as many blocks as possible, at each stage the game will become more difficult.
  • I seem to have a bug with my turret behavior. All my turrets are sometimes shooting 2 bullets instead of one. Is there a known fix for this?

  • Should be something wrong in your events. It's impossible to say without taking a look at it. If you can, share a capx. You can also take a look at the turret behavior template.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Like andreyin says, it is in your events not in the behavior itself. Go through your events line by line and also the properties panel for the turret behavior and you should spot where it is spawning two. If all else fails post your .capx or a screenshot of your events using mediafile or imgur and put spaces in the url if your rep isn't high enough w w w . f o rexample. c o m

  • These are all the events about the object. I don't see any issue with them.

    Can any system events be the problem?

  • Logically it looks to be ok. I would think the cannon ball is being spawned twice during the on-shoot during certain instances due to the angle calcs.. try adding a "trigger once" system condition to the angle calculation sub-events if it will let you.

  • Logically it looks to be ok. I would think the cannon ball is being spawned twice during the on-shoot during certain instances due to the angle calcs.. try adding a "trigger once" system condition to the angle calculation sub-events if it will let you.

    Didn't solve it, only make it sometimes not shoot at all.

    I think the problem is in the bullet spray. It rotates the turret same time as it shoots, so maybe it sometimes rotates back and triggers again. Any other way of making a bullet spray?

  • Ahh, yes I see it now. You are right if the angle is close to the min-max when it sets the random 4,8 angle it will trigger again.

    Hmm.. maybe create an event that simply sets a variable "canFire" that is set to 1 every tick that the turret "could" be firing and then condition that variable in the onshoot event.. canFire=1. It would need to be set to 0 whenever turret shouldn't be firing.

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