feat: implement player movement controller and initial weapon framework including double barrel shotgun and explosive projectiles
This commit is contained in:
@@ -146,12 +146,11 @@ func _apply_impulse() -> void:
|
||||
var push_dir = camera.global_transform.basis.z.normalized()
|
||||
|
||||
# Apply impulse to player velocity
|
||||
player.velocity += push_dir * impulse_strength
|
||||
|
||||
# Small hack to ensure we aren't considered on floor if we shoot down
|
||||
if push_dir.y > 0:
|
||||
# Just slightly lift the player to break floor contact immediately
|
||||
player.position.y += 0.05
|
||||
var final_force = push_dir * impulse_strength
|
||||
if multiplayer.has_multiplayer_peer() and multiplayer.multiplayer_peer is not OfflineMultiplayerPeer:
|
||||
player.server_apply_impulse.rpc_id(1, final_force)
|
||||
else:
|
||||
player.apply_impulse(final_force)
|
||||
|
||||
func _play_muzzle_flash() -> void:
|
||||
if muzzle_flash:
|
||||
|
||||
Reference in New Issue
Block a user