summaryrefslogtreecommitdiffstats
path: root/assets/weapons
diff options
context:
space:
mode:
authorMalfurious <m@lfurio.us>2022-09-12 03:37:12 -0400
committerMalfurious <m@lfurio.us>2022-09-12 03:37:12 -0400
commit31bc7653eb89688b9890523e1f2b39cc867837fc (patch)
treee5f25d2bfcf1205732707c0d89335f5d35d9904c /assets/weapons
parente9baf6602be3efbf5ea566b4e0c80a12c38f475e (diff)
parent355dcc29148461dd79815e76fa1a5a887a44ecc3 (diff)
downloadproject-s-31bc7653eb89688b9890523e1f2b39cc867837fc.tar.gz
project-s-31bc7653eb89688b9890523e1f2b39cc867837fc.zip
Merge branch 'dynamic-viewmodel'
* dynamic-viewmodel: ViewModel cycles characters on interact/ping Decouple ViewModel and the BaseCharacter Allow dynamic character material
Diffstat (limited to 'assets/weapons')
-rw-r--r--assets/weapons/goo_gun/Bullet.gd6
-rw-r--r--assets/weapons/goo_gun/GooGun.gd2
2 files changed, 8 insertions, 0 deletions
diff --git a/assets/weapons/goo_gun/Bullet.gd b/assets/weapons/goo_gun/Bullet.gd
index 1a4c01a..2edba6b 100644
--- a/assets/weapons/goo_gun/Bullet.gd
+++ b/assets/weapons/goo_gun/Bullet.gd
@@ -1,4 +1,10 @@
extends RigidBody
+export var material : Material = null
+
+func _ready():
+ if material != null:
+ $MeshInstance.set("material/0", material)
+
func _on_Bullet_body_entered(_body):
queue_free()
diff --git a/assets/weapons/goo_gun/GooGun.gd b/assets/weapons/goo_gun/GooGun.gd
index 6a6758d..6cb87fc 100644
--- a/assets/weapons/goo_gun/GooGun.gd
+++ b/assets/weapons/goo_gun/GooGun.gd
@@ -2,6 +2,7 @@ extends Spatial
export var is_firing = false
export var fire_rate = 0.075
+export var projectile_material : Material = null
export var projectile_spread = 0 #TODO
export var projectile_scalar = 40
export var look_angle = 0
@@ -22,6 +23,7 @@ func _physics_process(delta):
func do_fire_projectile():
var bullet = Bullet.instance()
+ bullet.material = projectile_material
$Nozzle.add_child(bullet)
bullet.set_as_toplevel(true)
var shoot_direction = Vector3.FORWARD.rotated(Vector3.LEFT, weapon_pitch)