19 lines
574 B
GDScript
19 lines
574 B
GDScript
extends CharacterBody3D
|
|
|
|
func _physics_process(delta: float) -> void:
|
|
if is_multiplayer_authority() == false:
|
|
return
|
|
|
|
velocity += get_gravity() * delta / 4
|
|
|
|
|
|
var collision = move_and_collide(velocity * delta)
|
|
if collision:
|
|
if collision.get_normal().y > 0:
|
|
var fire: Node3D = preload("res://weapons/molikman/molik/molikman_molotov_fire.tscn").instantiate()
|
|
Session.dynamic_objects_parent.add_child(fire,true)
|
|
fire.global_position = global_position
|
|
queue_free()
|
|
else:
|
|
var normal = collision.get_normal()
|
|
velocity = velocity.bounce(normal) * 0.5
|