Both poi.tscn and poi_gate.tscn had two problems stacking on top of each other: the solid StaticBody3D collider was a fixed-orientation BoxShape3D (with a Z-offset originally tuned for the old non-billboard ruins sprite), and the Area3D's own proximity-detection sphere also carried that same leftover Z-offset. Neither rotates with the sprite, which now billboards to face the camera (billboard=2) — so depending on viewing angle you'd either bump into invisible air or walk clean through the visible sprite, and the interact prompt appeared at wildly different distances depending on approach direction. Fix: replaced the oriented box with a centered CylinderShape3D (radius 1.0) for the solid collider — rotationally symmetric around Y, so it matches a billboarded sprite from any camera angle by construction, no per-frame reorientation needed. Removed the Z-offset from the Area3D's detection sphere and grew its radius to 1.3 (>= the solid cylinder's radius), so interaction becomes available at or before physical contact, not after pushing further in. Verified headless: drove the player at a POI from 4 different approach angles (0/90/180/270°) and measured both the distance where movement gets blocked and the distance where player_nearby flips true. Blocking distance is now consistent (~1.16-1.17 units) across all four angles instead of varying with direction, and in every case interaction was ready at or before the blocking distance.
52 lines
1.6 KiB
Plaintext
Executable File
52 lines
1.6 KiB
Plaintext
Executable File
[gd_scene format=3 uid="uid://be6ufrc3dsjge"]
|
|
|
|
[ext_resource type="Script" uid="uid://c12tpdqhr2l5" path="res://world/poi/poi.gd" id="1_gwpk6"]
|
|
[ext_resource type="Texture2D" uid="uid://c3ajv7vb8c4fb" path="res://assets/debug/checkerboard.png" id="2_yof6k"]
|
|
|
|
[sub_resource type="SphereShape3D" id="SphereShape3D_gwpk6"]
|
|
radius = 1.3
|
|
|
|
[sub_resource type="SpriteFrames" id="SpriteFrames_0surh"]
|
|
animations = [{
|
|
"frames": [{
|
|
"duration": 1.0,
|
|
"texture": ExtResource("2_yof6k")
|
|
}],
|
|
"loop": true,
|
|
"name": &"default",
|
|
"speed": 5.0
|
|
}]
|
|
|
|
[sub_resource type="CylinderShape3D" id="CylinderShape3D_58c6p"]
|
|
radius = 1.0
|
|
height = 2.4
|
|
|
|
[node name="POI" type="Area3D" unique_id=1770000468]
|
|
script = ExtResource("1_gwpk6")
|
|
|
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="." unique_id=2115487742]
|
|
shape = SubResource("SphereShape3D_gwpk6")
|
|
|
|
[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="." unique_id=1205831120]
|
|
billboard = 2
|
|
sprite_frames = SubResource("SpriteFrames_0surh")
|
|
|
|
[node name="StaticBody3D" type="StaticBody3D" parent="." unique_id=1488376384]
|
|
|
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="StaticBody3D" unique_id=461988177]
|
|
shape = SubResource("CylinderShape3D_58c6p")
|
|
|
|
[node name="Billboard" type="Node3D" parent="." unique_id=36237536]
|
|
transform = Transform3D(6, 0, 0, 0, 6, 0, 0, 0, 6, 0, 0, 0)
|
|
|
|
[node name="NameLabel" type="Label3D" parent="Billboard" unique_id=1419647885]
|
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.018201571, 0)
|
|
billboard = 1
|
|
text = "???"
|
|
font_size = 16
|
|
|
|
[node name="InteractionPrompt" type="Label3D" parent="Billboard" unique_id=2059219662]
|
|
visible = false
|
|
billboard = 1
|
|
font_size = 12
|