summaryrefslogtreecommitdiffstats
path: root/assets/characters/base_character/BaseCharacter.gd
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/characters/base_character/BaseCharacter.gd
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/characters/base_character/BaseCharacter.gd')
-rw-r--r--assets/characters/base_character/BaseCharacter.gd7
1 files changed, 7 insertions, 0 deletions
diff --git a/assets/characters/base_character/BaseCharacter.gd b/assets/characters/base_character/BaseCharacter.gd
index bcc0f26..5d1b013 100644
--- a/assets/characters/base_character/BaseCharacter.gd
+++ b/assets/characters/base_character/BaseCharacter.gd
@@ -1,10 +1,17 @@
extends KinematicBody
+export var material : Material = null
export var is_firing = false
export var look_angle = 0
export var weapon_pitch = 0
export var weapon_pitch_bias = deg2rad(20)
+func _ready():
+ look_angle = rotation.y
+ if material != null:
+ $Body.set("material/0", material)
+ $GooGun.projectile_material = material
+
func _process(_delta):
var effective_weapon_pitch = weapon_pitch - weapon_pitch_bias if is_firing else weapon_pitch
effective_weapon_pitch = clamp(effective_weapon_pitch, deg2rad(-90), deg2rad(90))