fix move events not firing

This commit is contained in:
Nitwel 2023-11-13 23:25:59 +01:00
parent 0208905123
commit 6827bcb83b
3 changed files with 24 additions and 21 deletions

View File

@ -23,22 +23,6 @@ animations = [{
"speed": 5.0 "speed": 5.0
}] }]
[sub_resource type="Animation" id="Animation_7o31s"]
resource_name = "light"
length = 0.3
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CSGCombiner3D:material_override:albedo_color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.3),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 0.85098, 0, 1), Color(0.231373, 0.231373, 0.231373, 1)]
}
[sub_resource type="Animation" id="Animation_afofi"] [sub_resource type="Animation" id="Animation_afofi"]
length = 0.001 length = 0.001
tracks/0/type = "value" tracks/0/type = "value"
@ -66,6 +50,22 @@ tracks/1/keys = {
"values": [Vector3(0, 0.0492394, -0.0903599)] "values": [Vector3(0, 0.0492394, -0.0903599)]
} }
[sub_resource type="Animation" id="Animation_7o31s"]
resource_name = "light"
length = 0.3
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CSGCombiner3D:material_override:albedo_color")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.3),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(1, 0.85098, 0, 1), Color(0.231373, 0.231373, 0.231373, 1)]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_8a76q"] [sub_resource type="AnimationLibrary" id="AnimationLibrary_8a76q"]
_data = { _data = {
"RESET": SubResource("Animation_afofi"), "RESET": SubResource("Animation_afofi"),

View File

@ -23,20 +23,19 @@ func _handle_move():
return return
var distance = ray.get_collision_point().distance_to(_click_point) var distance = ray.get_collision_point().distance_to(_click_point)
var collider = ray.get_collider()
if distance > 0.02: if _moved || distance > 0.02:
if _is_pressed: if _is_pressed:
_call_fn(collider, "_on_press_move") _call_fn(_last_collided, "_on_press_move")
_moved = true _moved = true
if _is_grabbed: if _is_grabbed:
_call_fn(collider, "_on_grab_move") _call_fn(_last_collided, "_on_grab_move")
_moved = true _moved = true
func _handle_enter_leave(): func _handle_enter_leave():
var collider = ray.get_collider() var collider = ray.get_collider()
if collider == _last_collided: if collider == _last_collided || _is_grabbed || _is_pressed:
return return
_call_fn(collider, "_on_ray_enter") _call_fn(collider, "_on_ray_enter")

View File

@ -7,6 +7,10 @@ var request_timeout := 10.0
var url := "ws://192.168.33.33:8123/api/websocket" var url := "ws://192.168.33.33:8123/api/websocket"
var token := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzZjQ0ZGM2N2Y3YzY0MDc1OGZlMWI2ZjJlNmIxZjRkNSIsImlhdCI6MTY5ODAxMDcyOCwiZXhwIjoyMDEzMzcwNzI4fQ.K6ydLUC-4Q7BNIRCU1nWlI2s6sg9UCiOu-Lpedw2zJc" var token := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiIzZjQ0ZGM2N2Y3YzY0MDc1OGZlMWI2ZjJlNmIxZjRkNSIsImlhdCI6MTY5ODAxMDcyOCwiZXhwIjoyMDEzMzcwNzI4fQ.K6ydLUC-4Q7BNIRCU1nWlI2s6sg9UCiOu-Lpedw2zJc"
# var url := "wss://8ybjhqcinfcdyvzu.myfritz.net:8123/api/websocket"
# var token := "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJjNjU0ZDE3NDc2ZGM0NzU1OGY5NjIzMmM5ZjdjYzE2YSIsImlhdCI6MTY5OTgyMzcxOCwiZXhwIjoyMDE1MTgzNzE4fQ.XHlfnXUd16HaV9XjYrxzuNg23nFFeoEsIsaMVXwRkd8"
var LOG_MESSAGES := false var LOG_MESSAGES := false
var authenticated := false var authenticated := false