PCK File loader

This commit is contained in:
2023-01-02 17:55:28 +01:00
parent 4de8162f48
commit 701bcfd39c
11 changed files with 100 additions and 49 deletions

View File

@@ -90,7 +90,7 @@ func accelerate(delta : float, p_target_dir : Vector3, p_target_speed : float, p
func apply_friction(delta : float):
var vec : Vector3 = velocity
#var vec : Vector3 = velocity
var speed : float = velocity.length()
if is_zero_approx(speed):
velocity = Vector3.ZERO

View File

@@ -39,12 +39,8 @@ func Init_Config(config):
for weapon in config.get_sections():
var root = Weapon.new()
root.name = weapon
var weapon_model = Runtimeloader.load_gltf(config.get_value(weapon, "MODEL")) as Node3D
var old_parent = weapon_model.get_parent()
old_parent.remove_child(weapon_model)
#Set Weapon nodes
root.add_child(weapon_model)
var weapon_model = Runtimeloader.load_gltf(config.get_value(weapon, "MODEL"), root) as Node3D
root.position = config.get_value(weapon, "HAND_POS")
root.rotation = config.get_value(weapon, "HAND_ROT")
root.hide()