There is another problem

func fire():
	var bullet_exemplar = bullet.instantiate()
	bullet_exemplar.position = get_global_position()
	bullet_exemplar.rotation_degrees = rotation_degrees
	bullet_exemplar.apply_impulse(Vector2(), Vector2(bullet_speed, 0).rotated(rotation))
	get_tree().get_root().call_deferred("add_child", bullet_exemplar)

it’s function that should fire bullets, but bullets are not shooting, they’re just spawning and falling, i checked logically and it’s should shoot, because there bullet_exemplar.apply_impulse(Vector2(), Vector2(bullet_speed, 0).rotated(rotation))
Vector2(x;y) receives x=bullet_speed and y=0, it should’nt fall, it should fly! but why

does it move along the x axis at all?

it doesn’t

just switch:

bullet_exemplar.apply_impulse(Vector2(), Vector2(bullet_speed, 0).rotated(rotation))

with:

bullet_exemplar.apply_impulse(Vector2(bullet_speed, 0),Vector2().rotated(rotation))

The first value passed into apply_impulse() is actually what makes the object move, the second value, i believe, is where on the object the impulse is applied.

strange, but thank you again

You’re welcome

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.