tutorial is set up and final lift as well
This commit is contained in:
28
assets/lift/lift.gd
Normal file
28
assets/lift/lift.gd
Normal file
@@ -0,0 +1,28 @@
|
||||
extends Node3D
|
||||
|
||||
var lift_already_used : bool = false
|
||||
|
||||
@export var end_location : Vector3 = Vector3.ZERO
|
||||
@export var lift_time : float = 1.0
|
||||
|
||||
@onready var button: MeshInstance3D = $Cylinder_001
|
||||
|
||||
func start_climbing() -> void:
|
||||
var elevator_tween = get_tree().create_tween()
|
||||
elevator_tween.set_ease(Tween.EASE_IN_OUT)
|
||||
elevator_tween.set_trans(Tween.TRANS_CUBIC)
|
||||
elevator_tween.tween_property(self, "global_position", end_location, lift_time)
|
||||
|
||||
|
||||
func _on_area_3d_body_entered(body: Node3D) -> void:
|
||||
if lift_already_used:
|
||||
return
|
||||
|
||||
if is_instance_of(body, CharacterBody3D):
|
||||
lift_already_used = true
|
||||
|
||||
var button_tween = get_tree().create_tween()
|
||||
var button_final_pos = button.global_position + Vector3.DOWN * 0.35
|
||||
button_tween.tween_property(button, "global_position", button_final_pos, 0.3)
|
||||
button_tween.tween_callback(start_climbing)
|
||||
|
||||
1
assets/lift/lift.gd.uid
Normal file
1
assets/lift/lift.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c1w84vh3bqijr
|
||||
BIN
assets/lift/lift.glb
Normal file
BIN
assets/lift/lift.glb
Normal file
Binary file not shown.
42
assets/lift/lift.glb.import
Normal file
42
assets/lift/lift.glb.import
Normal file
@@ -0,0 +1,42 @@
|
||||
[remap]
|
||||
|
||||
importer="scene"
|
||||
importer_version=1
|
||||
type="PackedScene"
|
||||
uid="uid://cc2vcuaulfks3"
|
||||
path="res://.godot/imported/lift.glb-e7e66d0f097e30a0a067073f130adce8.scn"
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://assets/lift/lift.glb"
|
||||
dest_files=["res://.godot/imported/lift.glb-e7e66d0f097e30a0a067073f130adce8.scn"]
|
||||
|
||||
[params]
|
||||
|
||||
nodes/root_type=""
|
||||
nodes/root_name=""
|
||||
nodes/root_script=null
|
||||
nodes/apply_root_scale=true
|
||||
nodes/root_scale=1.0
|
||||
nodes/import_as_skeleton_bones=false
|
||||
nodes/use_name_suffixes=true
|
||||
nodes/use_node_type_suffixes=true
|
||||
meshes/ensure_tangents=true
|
||||
meshes/generate_lods=true
|
||||
meshes/create_shadow_meshes=true
|
||||
meshes/light_baking=1
|
||||
meshes/lightmap_texel_size=0.2
|
||||
meshes/force_disable_compression=false
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
animation/remove_immutable_tracks=true
|
||||
animation/import_rest_as_RESET=false
|
||||
import_script/path=""
|
||||
materials/extract=0
|
||||
materials/extract_format=0
|
||||
materials/extract_path=""
|
||||
_subresources={}
|
||||
gltf/naming_version=2
|
||||
gltf/embedded_image_handling=1
|
||||
33
assets/lift/lift.tscn
Normal file
33
assets/lift/lift.tscn
Normal file
File diff suppressed because one or more lines are too long
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user