[SOLVED]Is it possible to give the fire bullet behavior accuracy?

As the title says, because I’m creating different weapons like a machine gun and mini-gun and I want them to have accuracy penalties as I dont want all of my weapons to have pinpoint accuracy.

It depends on how you’re shooting. There’s an angle variance. IDK if there’s any other settings.

You can target a position like enemy x,y and then add a random number to the x and y

Something like this for x and y where a is either a scene/global variable or a weapon/projectile object variable. Change the value as needed. Say a range of -20 to -20.

Enemy.X() + RandomInRange(-Variable(a),Variable(a))

Another option is add a compare 2 numbers condition to the collision event. If collision and random number > 5 then do something.

If collision then delete bullet
If random(10) > 5 then count as hit

(Either or both numbers could be a variable)

The advantage of the 1st version is realism. It could always still hit something just not the target.

The 2nd method is simplier and deletes the bullet either way.

IDK your game. You could award points or add damage based on the accuracy.

Use the FireBullet Behavoir

and play with this value.

you can even change this value by events in your leveling system

Oh I see, sorry I added bullet behavior but didn’t bother playing around with it, and thanks!

So this thread can be closed now.

great, leave a like and maybe you have to close it by yourself idk
put a SOLVED into the topic