A Third-Person-Shooter Godot game.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

13 lines
580 B

extends Spatial
func shoot(player, shoot_origin, shoot_dir, col):
if col:
if col.collider and col.collider.has_method("hit"):
col.collider.hit(col)
var shoot_particle = player.get_node("GlobalShootParticle") # Don't want it as child of player model
shoot_particle.global_transform.origin = shoot_origin + shoot_dir # An attempt to put it further forward than shoot_origin
shoot_particle.look_at(shoot_origin + 2*shoot_dir, Vector3.UP) # ^
shoot_particle.emitting = true
var muzzle_particle = $MuzzleFlash
muzzle_particle.restart()
muzzle_particle.emitting = true