armies can movies

This commit is contained in:
oughtum 2024-08-16 23:59:49 +01:00
parent 909008457b
commit 91a908ca20
4 changed files with 25 additions and 11 deletions

View file

@ -55,3 +55,9 @@ ActivateArm6={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":54,"key_label":0,"unicode":54,"location":0,"echo":false,"script":null)
]
}
[layer_names]
3d_physics/layer_1="World"
3d_physics/layer_2="RaycastPlane"
3d_physics/layer_3="Arm"

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=6 format=3 uid="uid://dgm3241ceqpim"]
[gd_scene load_steps=7 format=3 uid="uid://dgm3241ceqpim"]
[ext_resource type="Script" path="res://scripts/body.gd" id="1_21au4"]
[ext_resource type="PackedScene" uid="uid://nusoljma3t55" path="res://scenes/pickaxe_arm.tscn" id="2_m4hhp"]
@ -11,6 +11,9 @@ height = 10.0
[sub_resource type="SphereShape3D" id="SphereShape3D_16w3w"]
radius = 5.0
[sub_resource type="WorldBoundaryShape3D" id="WorldBoundaryShape3D_vlifr"]
plane = Plane(1000, 0, 0, 0)
[node name="Body" type="RigidBody3D" node_paths=PackedStringArray("arms")]
axis_lock_linear_x = true
axis_lock_angular_z = true
@ -31,3 +34,10 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 4.8945, 0)
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 32, 0, 0)
script = ExtResource("3_mslwr")
[node name="RaycastPlane" type="StaticBody3D" parent="."]
collision_layer = 2
collision_mask = 0
[node name="CollisionShape3D" type="CollisionShape3D" parent="RaycastPlane"]
shape = SubResource("WorldBoundaryShape3D_vlifr")

View file

@ -38,12 +38,14 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="UI" type="Control" parent="CanvasLayer"]
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
mouse_filter = 2
metadata/_edit_lock_ = true
[node name="World" type="Node3D" parent="."]
@ -76,4 +78,4 @@ skeleton = NodePath("../..")
shape = SubResource("BoxShape3D_qcnmp")
[node name="Body" parent="World" instance=ExtResource("1_eeca8")]
transform = Transform3D(-0.405636, -0.914035, 0, 0.914035, -0.405636, 0, 0, 0, 1, 0, 11.4413, 0)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 6, 0)

View file

@ -2,18 +2,12 @@ class_name Arm extends Node3D
@onready var camera: Camera3D = $"../../Camera3D"
@onready var target: Marker3D = $Target
@onready var ik_skeleton: SkeletonIK3D = $Skeleton3D/SkeletonIK3D
@export var action: StringName
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
pass
ik_skeleton.start()
func update_target_pos() -> void:
var mouse_pos: Vector2 = camera.get_window().get_mouse_position()
@ -28,4 +22,6 @@ func update_target_pos() -> void:
if collision == null: return
var arm_target_pos: Vector3 = collision["position"]
target.global_position = arm_target_pos
print(collision)
target.global_position.z = arm_target_pos.z
target.global_position.y = arm_target_pos.y