moved break function and gun feel tweaks
This commit is contained in:
@@ -394,8 +394,9 @@ _data = {
|
||||
[node name="mac10" node_paths=PackedStringArray("flare_light", "anim_player", "barrel_raycast", "casing_ejector", "mag_ejector", "audio_fire", "audio_empty", "audio_reload") instance=ExtResource("1_nb4p5")]
|
||||
script = ExtResource("2_6i1l4")
|
||||
gun_name = "Mac 10"
|
||||
recoil_amount = 0.4
|
||||
max_ammo = 30
|
||||
bullet_drop = 0.05
|
||||
bullet_drop = 0.1
|
||||
random_spread_amt = 0.3
|
||||
fire_pitch_scale_amt = 0.1
|
||||
flare_light = NodePath("mac10/SpotLight3D")
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -11,3 +11,11 @@ func _ready():
|
||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
||||
func _process(delta):
|
||||
pass
|
||||
|
||||
func breaking():
|
||||
var spawn_broken = broken_object.instantiate()
|
||||
spawn_broken.position = global_position
|
||||
spawn_broken.transform.basis = global_transform.basis
|
||||
spawn_broken.rotation = rotation
|
||||
get_tree().get_root().add_child(spawn_broken)
|
||||
queue_free()
|
||||
|
||||
@@ -59,11 +59,8 @@ func _process(delta):
|
||||
ray.get_collider().linear_velocity += transform.basis * Vector3(0,0,-1 * 5)
|
||||
|
||||
if ray.get_collider().is_in_group("breakable"):
|
||||
var spawn_broken = ray.get_collider().broken_object.instantiate()
|
||||
spawn_broken.position = ray.get_collider().global_position
|
||||
spawn_broken.transform.basis = ray.get_collider().global_transform.basis
|
||||
get_tree().get_root().add_child(spawn_broken)
|
||||
ray.get_collider().queue_free()
|
||||
ray.get_collider().breaking()
|
||||
|
||||
|
||||
if ray.get_collider().is_in_group("enemy"):
|
||||
print("enemy hit")
|
||||
|
||||
Reference in New Issue
Block a user