And I have made this bit of code to do it:
For some context a Node2D has this code in a script, and $BulletSpawnPoint is a Marker2D that is placed a small distance below the Node2D, and is a child of it.
var new_bullet
for i in 24:
new_bullet = used_bullet_pool.pop_front() #used_bullet_pool is an array
new_bullet.wake($BulletSpawnPoint.global_position, rotation) #places the bullet in the markers position and sets the angle it should move at
rotation_degrees += 15
print(i)
print(rotation_degrees)
print($BulletSpawnPoint.global_position)
Its shooting a circle of bullets as I wanted, but it isn’t shooting 24 bullets spread every 15 degrees, its shooting 12 bullets spread by 30 degrees instead. Here is the text output from these print statements:
0
15.0000009536743
(626.059, 208.2963)
1
30.0000019073486
(614, 203.3013)
2
45
(603.6447, 195.3553)
3
60.0000038146973
(595.6987, 185)
4
75
(590.7037, 172.9409)
5
90
(589, 160)
6
105
(590.7037, 147.0591)
7
120.000007629395
(595.6987, 135)
8
135
(603.6447, 124.6447)
9
150
(614, 116.6987)
10
165
(626.059, 111.7037)
11
180
(639, 110)
12
195
(651.941, 111.7037)
13
210
(664, 116.6987)
14
225
(674.3553, 124.6447)
15
240.000015258789
(682.3013, 135)
16
255
(687.2963, 147.0591)
17
270
(689, 160)
18
285
(687.2963, 172.9409)
19
300
(682.3013, 185)
20
315
(674.3553, 195.3553)
21
330
(664, 203.3013)
22
345
(651.941, 208.2963)
23
360
(639, 210)
Here’s a picture (ignore the pink bullets in the corner)
What’s going on here?