Fixed bullets following player

This commit is contained in:
Kristofers Solo
2021-11-11 20:21:36 +02:00
parent f9f54a02e7
commit 5f38a545a7
2 changed files with 66 additions and 66 deletions

View File

@@ -295,7 +295,7 @@ func choose_trajectory():
sync func shoot(trajectory:String, id):
bullet = bullet_env[trajectory].instance()
add_child(bullet)
get_parent().add_child(bullet)
bullet.global_position = shoot_point.global_position
bullet.global_rotation = shoot_point.global_rotation
# bullet.player_owner = id
@@ -303,7 +303,7 @@ sync func shoot(trajectory:String, id):
func enable_trajectory_line(trajectory_line:String):
var x = bullet_trajectory[trajectory_line].instance()
add_child(x)
get_parent().add_child(x)
x.global_position = shoot_point.global_position
x.global_rotation = shoot_point.global_rotation