Invalid set index 'position' (on base: 'RigidBody2D') with value of type 'Callable'[Solved]

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Lucksinia

So, I have this snippet of a function that creates instance of a Bullet(RigidBody2D) on position of $BulletPoint(Node2D):

func create_bullet_instance(object:Bullet):
  var bullet_instance = bullet.instantiate()
  bullet_instance.position = bullet_point.get_global_position
  bullet_instance.rotation_degrees = rotation_degrees
  bullet_instance.apply_impulse(Vector2(0,0), Vector2(object.speed, 0).rotated(rotation))
  get_tree().get_root().add_child(bullet_instance)
  await get_tree().create_timer(object.lifetime).timeout
  bullet_instance.queue_free()

And, apparently, rotation is still got up from Node2D, but not position?
What do I do in this case?

:bust_in_silhouette: Reply From: spaceyjase
bullet_instance.position = bullet_point.get_global_position

Shouldn’t this be get_global_position()? The script is attempting to assign the method (a Callable) to position (global_position should suffice).

My… Okay, That was it. Thank you good sir… That was it…
And I spend more than a day on missing brackets…

Lucksinia | 2023-03-16 15:14