simplified the gun folded check
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -182,25 +182,19 @@ func _physics_process(delta):
|
|||||||
gun.anim_player.play("shoot")
|
gun.anim_player.play("shoot")
|
||||||
|
|
||||||
# shoot real bullet from camera
|
# shoot real bullet from camera
|
||||||
if gun_folded == false:
|
|
||||||
instance_bullet = gun.bullet.instantiate()
|
|
||||||
instance_bullet.position = bullet_ray.global_position
|
|
||||||
instance_bullet.transform.basis = bullet_ray.global_transform.basis
|
|
||||||
instance_bullet.bullet_speed = gun.bullet_speed
|
|
||||||
instance_bullet.bullet_drop = gun.bullet_drop
|
|
||||||
instance_bullet.random_spread_amt = gun.random_spread_amt
|
|
||||||
instance_bullet.gun = gun
|
|
||||||
get_parent().add_child(instance_bullet)
|
|
||||||
else:
|
|
||||||
instance_bullet = gun.bullet.instantiate()
|
|
||||||
instance_bullet.position = gun.barrel_raycast.global_position
|
|
||||||
instance_bullet.transform.basis = gun.barrel_raycast.global_transform.basis
|
|
||||||
instance_bullet.bullet_speed = gun.bullet_speed
|
|
||||||
instance_bullet.bullet_drop = gun.bullet_drop
|
|
||||||
instance_bullet.random_spread_amt = gun.random_spread_amt
|
|
||||||
instance_bullet.gun = gun
|
|
||||||
get_parent().add_child(instance_bullet)
|
|
||||||
|
|
||||||
|
instance_bullet = gun.bullet.instantiate()
|
||||||
|
if gun_folded == false:
|
||||||
|
instance_bullet.position = bullet_ray.global_position
|
||||||
|
else:
|
||||||
|
instance_bullet.position = gun.barrel_raycast.global_position
|
||||||
|
instance_bullet.transform.basis = bullet_ray.global_transform.basis
|
||||||
|
instance_bullet.bullet_speed = gun.bullet_speed
|
||||||
|
instance_bullet.bullet_drop = gun.bullet_drop
|
||||||
|
instance_bullet.random_spread_amt = gun.random_spread_amt
|
||||||
|
instance_bullet.gun = gun
|
||||||
|
print("bullet coords: " + str(instance_bullet.position))
|
||||||
|
get_parent().add_child(instance_bullet)
|
||||||
# Casing transform
|
# Casing transform
|
||||||
instance_casing = gun.casing.instantiate()
|
instance_casing = gun.casing.instantiate()
|
||||||
instance_casing.position = gun.casing_ejector.global_position
|
instance_casing.position = gun.casing_ejector.global_position
|
||||||
@@ -233,7 +227,6 @@ func _headbob(time) -> Vector3:
|
|||||||
var pos = Vector3.ZERO
|
var pos = Vector3.ZERO
|
||||||
pos.y = sin(time * BOB_FREQ) * BOB_AMP
|
pos.y = sin(time * BOB_FREQ) * BOB_AMP
|
||||||
pos.x = cos(time * BOB_FREQ / 2) * BOB_AMP
|
pos.x = cos(time * BOB_FREQ / 2) * BOB_AMP
|
||||||
print("hello")
|
|
||||||
return pos
|
return pos
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user