im trying to make a bullet hell spread based on the node's rotation and convert it to vector however when i try to increase the node's rotation using the customRot it always stays at 0. Note that setting global_rotation to 0 is called after rotating, Idk why but it should've been rotated way past before it. Dunno what's the cause of the problem for this can anybody inspect?'

func _shoot(customSpd: int = 0, customRot: float = 0):
if timer.is_stopped():
timer.start()
for i in repeat:
var b = bullet.instance() as BulletClass
b.global_position = global_position

		if repeat != 1:
			var arcRad = deg2rad(arc)
			var inc = arcRad / (repeat - 1)
			global_rotation += inc * i - arcRad / 2
		
		b.dir = Vector2.RIGHT.rotated(global_rotation + customRot)
		
		if customSpd > 0: b.spd = customSpd
		
		get_tree().root.call_deferred("add_child", b)
		global_rotation = 0

this is the code for the bullet class:

extends Area2D
class_name BulletClass

export var spd: int = 100
export var dmg: int = 1

var dir: Vector2 = Vector2.RIGHT

func _die(): pass

func hit_on_area(obj):
if obj is HurtboxClass:
obj.
decrease(dmg)
_die()

func _hit_on_body(obj):
if obj is TileMap or obj is StaticBody2D:
_die()

func _movement(delta): translate(dir * spd * delta)

    Setting the global position has no effect if the instance isn't in the tree. I guess the same goes for the global_rotation.
    Try adding it to the tree first, then set global_position and global_rotation.

      icewall when i try to increase the node's rotation using the customRot it always stays at 0

      How did you determine that?

      trizZzle this looks like godot 3 code. look:
      var b = bullet.instance() as BulletClass

      what's dir?
      b.dir

      icewall func _shoot(customSpd: int = 0, customRot: float = 0):

      are you passing customRot? look at where this is called. since you are defining a default value it could be passing only one parameter and not throwing an error.

      icewall get_tree().root.call_deferred("add_child", b)

      you are adding the node in the next frame. why?
      you are on a for loop, if you don't add the node RIGHT NOW, it's probably going to be overridden.

      icewall global_rotation = 0

      you are reseting global_rotation at the end of each iteration of the for loop.