made a rat and a ladder and the rat is *kind* of working

This commit is contained in:
Derek
2024-07-27 21:08:41 -05:00
parent 94ddefc7f5
commit 186aa89e3f
39 changed files with 5191 additions and 46 deletions

27
scripts/rat.gd Normal file
View File

@@ -0,0 +1,27 @@
extends RigidBody3D
@onready var anim_player = $AnimationPlayer
@export var dead_rat : Resource
var end_hole
var control_node
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if end_hole != null:
var move_direction = end_hole.global_position - self.position
self.set_linear_velocity(move_direction * 1)
#self.look_at(end_hole.position,Vector3.UP)
func breaking(bullet_velocity):
var spawn_broken = dead_rat.instantiate()
spawn_broken.position = global_position
spawn_broken.transform.basis = global_transform.basis
spawn_broken.rotation = rotation
var pieces = spawn_broken.get_children()
get_tree().get_root().add_child(spawn_broken)
queue_free()