Advertisement
otorp2

shoot_from simple code

Aug 29th, 2015
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. if (shooting and not prev_shooting):
  2. # just pressed
  3. var shot = preload("res://shot.scn").instance()
  4. #use the position3d as reference
  5. shot.set_pos( get_node("shootfrom").get_global_pos() )
  6. #put it two parents above, so it is not moved by us
  7. get_node("../..").add_child(shot)
  8. #play sound
  9. get_node("sfx").play("shoot")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement