Fixed some errors
This commit is contained in:
parent
87919ed890
commit
e6a47a4772
9 changed files with 32 additions and 32 deletions
|
|
@ -3,10 +3,12 @@ extends WeaponState
|
|||
@export var emptyable: bool
|
||||
|
||||
func _enter() -> void:
|
||||
|
||||
machine.animation_player.play(with_morphems("intro"))
|
||||
machine.animation_player.animation_finished.connect(on_animation_finished)
|
||||
|
||||
func _exit() -> void:
|
||||
|
||||
machine.animation_player.animation_finished.disconnect(on_animation_finished)
|
||||
|
||||
func on_animation_finished(animation):
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
extends RigidBody3D
|
||||
extends CharacterBody3D
|
||||
|
||||
|
||||
var contacts: int = 0
|
||||
|
||||
func _on_body_entered(_body: Node) -> void:
|
||||
contacts += 1
|
||||
if contacts > 2:
|
||||
var fire = preload("uid://l4t1mflutm3t").instantiate()
|
||||
func _physics_process(delta: float) -> void:
|
||||
|
||||
velocity += get_gravity() * delta
|
||||
|
||||
if is_on_floor():
|
||||
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()
|
||||
|
||||
move_and_slide()
|
||||
|
|
|
|||
|
|
@ -1,10 +1,7 @@
|
|||
[gd_scene load_steps=6 format=3 uid="uid://b6qahd6q60js7"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://b6qahd6q60js7"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://y1s64ppporww" path="res://weapons/molikman/molik/molik.gd" id="1_aqokr"]
|
||||
|
||||
[sub_resource type="PhysicsMaterial" id="PhysicsMaterial_aqokr"]
|
||||
bounce = 0.53
|
||||
|
||||
[sub_resource type="SphereMesh" id="SphereMesh_fwcyt"]
|
||||
radius = 0.05
|
||||
height = 0.1
|
||||
|
|
@ -17,13 +14,8 @@ properties/0/path = NodePath(".:position")
|
|||
properties/0/spawn = true
|
||||
properties/0/replication_mode = 1
|
||||
|
||||
[node name="Molik" type="RigidBody3D"]
|
||||
[node name="Molik" type="CharacterBody3D"]
|
||||
collision_layer = 8
|
||||
physics_material_override = SubResource("PhysicsMaterial_aqokr")
|
||||
gravity_scale = 0.25
|
||||
continuous_cd = true
|
||||
contact_monitor = true
|
||||
max_contacts_reported = 2
|
||||
script = ExtResource("1_aqokr")
|
||||
|
||||
[node name="MeshInstance3D" type="MeshInstance3D" parent="."]
|
||||
|
|
@ -34,5 +26,3 @@ shape = SubResource("SphereShape3D_aqokr")
|
|||
|
||||
[node name="MultiplayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
|
||||
replication_config = SubResource("SceneReplicationConfig_6ic6f")
|
||||
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ func fire() -> void:
|
|||
machine.animation_player.play(machine.animation_prefix + "shoot")
|
||||
|
||||
if is_multiplayer_authority():
|
||||
var molotov: RigidBody3D = molik.instantiate()
|
||||
var molotov: CharacterBody3D = molik.instantiate()
|
||||
Session.dynamic_objects_parent.add_child(molotov,true)
|
||||
molotov.global_transform = machine.player_camera.global_transform
|
||||
molotov.apply_impulse(-molotov.global_basis.z * 10)
|
||||
molotov.velocity = -molotov.global_basis.z * 100
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue