Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | BG.13 |
I have a player node that shoots out an arrow when pressing a button. It works fine on my PC but when I exported it to Android the arrow scene won’t spawn even though the shoot function that calls the arrow still works perfectly. The arrow is a Kinematic Body.
This is my script:
func _Spawn_Arrow():
var arrow = ArrowScene.instance()
var arrow_spawn_pos = $Body/Bow_Hand/Arrow_Spawner
get_tree().get_root().add_child(arrow)
arrow.global_position = arrow_spawn_pos.global_position
arrow.direction = (arrow_spawn_pos.global_position - get_global_mouse_position()).normalized()
arrow.rotation = arrow.direction.angle()
arrow._launch(arrow.direction * Arrow_Speed)