more collision tweaks and fixed gun folding
This commit is contained in:
@@ -96,7 +96,7 @@ func shoot(delta):
|
||||
if player.gun_folded == false:
|
||||
instance_bullet.transform.basis = player.bullet_ray.global_transform.basis
|
||||
else:
|
||||
instance_bullet.transform.basis = barrel_raycast.global_transform.basis
|
||||
instance_bullet.transform.basis = barrel_raycast.global_transform.basis
|
||||
instance_bullet.bullet_speed = bullet_speed
|
||||
instance_bullet.player_velocity = player.velocity
|
||||
instance_bullet.bullet_drop = bullet_drop
|
||||
|
||||
@@ -234,8 +234,7 @@ func _physics_process(delta):
|
||||
gun.cycle_count = gun.cycle_count_start
|
||||
|
||||
# Gun folding out of the way
|
||||
if gun_ray.is_colliding() and !gun_ray.get_collider().is_in_group("player"):
|
||||
#check distance to wall later ?
|
||||
if gun_ray.is_colliding():
|
||||
gun.rotation = lerp(gun.rotation, Vector3(1, -1, -.25), delta * 10)
|
||||
gun.position = lerp(gun.position, Vector3(gun.start_position.x-.15,gun.start_position.y +.2,gun.start_position.z +.6),(delta*10))
|
||||
gun_folded = true
|
||||
|
||||
Reference in New Issue
Block a user