parent
74a75b6193
commit
09986a63f5
@ -1,5 +1,5 @@ |
|||||||
[folding] |
[folding] |
||||||
|
|
||||||
node_unfolds=[NodePath("Grid"), PackedStringArray("Transform", "Cell", "Navigation"), NodePath("WorldEnvironment"), PackedStringArray("environment"), NodePath("Ocean/Mesh"), PackedStringArray("Transform", "Skeleton", "mesh"), NodePath("Ocean/CollisionShape3D"), PackedStringArray("shape"), NodePath("DirectionalLight3D"), PackedStringArray("Transform", "Light", "Shadow", "Directional Shadow"), NodePath("Highlighter"), PackedStringArray("Transform"), NodePath("Camera3D"), PackedStringArray("Transform")] |
node_unfolds=[NodePath("Grid"), PackedStringArray("Transform", "Cell", "Navigation", "Collision"), NodePath("WorldEnvironment"), PackedStringArray("environment"), NodePath("Ocean"), PackedStringArray("Collision"), NodePath("Ocean/Mesh"), PackedStringArray("Transform", "Skeleton", "mesh"), NodePath("Ocean/CollisionShape3D"), PackedStringArray("shape"), NodePath("DirectionalLight3D"), PackedStringArray("Transform", "Light", "Shadow", "Directional Shadow"), NodePath("Highlighter"), PackedStringArray("Transform"), NodePath("Camera3D"), PackedStringArray("Transform")] |
||||||
resource_unfolds=["res://scenes/3DWorld.tscn::PlaneMesh_7x62x", PackedStringArray("Resource"), "res://scenes/3DWorld.tscn::BoxShape3D_g3t7x", PackedStringArray()] |
resource_unfolds=["res://scenes/3DWorld.tscn::PlaneMesh_7x62x", PackedStringArray("Resource"), "res://scenes/3DWorld.tscn::BoxShape3D_g3t7x", PackedStringArray()] |
||||||
nodes_folded=[] |
nodes_folded=[] |
||||||
|
|||||||
@ -1,5 +1,5 @@ |
|||||||
[folding] |
[folding] |
||||||
|
|
||||||
node_unfolds=[NodePath("Pivot/MeshInstance3D"), PackedStringArray("Skeleton")] |
node_unfolds=[NodePath("Pivot"), PackedStringArray("Transform"), NodePath("Pivot/MeshInstance3D"), PackedStringArray("Skeleton", "mesh"), NodePath("CollisionShape3D"), PackedStringArray("shape", "Transform"), NodePath("RayCast3D"), PackedStringArray("Transform", "Collide With")] |
||||||
resource_unfolds=["res://scenes/Instance.tscn::CapsuleMesh_qsbqh", PackedStringArray(), "res://scenes/Instance.tscn::CapsuleShape3D_ed37x", PackedStringArray()] |
resource_unfolds=["res://scenes/Instance.tscn::CapsuleMesh_qsbqh", PackedStringArray(), "res://scenes/Instance.tscn::CapsuleShape3D_ed37x", PackedStringArray()] |
||||||
nodes_folded=[] |
nodes_folded=[] |
||||||
|
|||||||
@ -1,13 +1,20 @@ |
|||||||
extends CharacterBody3D |
extends CharacterBody3D |
||||||
|
|
||||||
var id = -1 |
var id = -1 |
||||||
|
@onready var ray = $RayCast3D |
||||||
|
|
||||||
|
func _process(delta): |
||||||
|
var height = ray.get_collision_point().y |
||||||
|
if position.y != height: |
||||||
|
var tween = get_tree().create_tween() |
||||||
|
tween.tween_property(self, "position:y", height, 0.1) |
||||||
|
|
||||||
func connect_to_world(id): |
func connect_to_world(id): |
||||||
var world_entity = Global.world.entities[id] |
var world_entity = Global.world.entities[id] |
||||||
world_entity.moving.connect(_on_entity_moving) |
world_entity.moving.connect(_on_entity_moving) |
||||||
pass |
|
||||||
|
|
||||||
func _on_entity_moving(new_position, speed): |
func _on_entity_moving(new_position, speed): |
||||||
var tween = get_tree().create_tween() |
var x_tween = get_tree().create_tween() |
||||||
tween.tween_property(self, "position", new_position, 1.0/speed) |
var z_tween = get_tree().create_tween() |
||||||
pass |
x_tween.tween_property(self, "position:x", new_position.x, 1.0/speed) |
||||||
|
z_tween.tween_property(self, "position:z", new_position.y, 1.0/speed) |
||||||
|
|||||||
Loading…
Reference in new issue