discomrade
f3bf534682
This commit is equal to version 0.0.2. Version 0.0.1 source code is available on archive.org
14 lines
580 B
GDScript
14 lines
580 B
GDScript
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
|