fix: character uses force, not impulse, now
This commit is contained in:
parent
3cd721e522
commit
f3fa31f12e
|
|
@ -9,13 +9,13 @@ extends Node3D
|
||||||
@export var arrival_time : float = 15.0
|
@export var arrival_time : float = 15.0
|
||||||
@export var pre_leave_time : float = 20.0
|
@export var pre_leave_time : float = 20.0
|
||||||
@export var door_close_time : float = 1.0
|
@export var door_close_time : float = 1.0
|
||||||
@export var leave_time : float = 16.0
|
@export var leave_time : float = 15.0
|
||||||
@export var post_leave_time : float = 5.0
|
@export var post_leave_time : float = 5.0
|
||||||
|
|
||||||
@onready var origination : Node3D = $Origination
|
@onready var origination : Node3D = $Origination
|
||||||
@onready var destination : Node3D = $Destination
|
@onready var destination : Node3D = $Destination
|
||||||
|
|
||||||
@onready var subway : SubwayTrain = $Train
|
@onready var subway : SubwayTrain = $Subway
|
||||||
|
|
||||||
var tween : Tween = null
|
var tween : Tween = null
|
||||||
|
|
||||||
|
|
@ -31,19 +31,13 @@ func cycle() -> void:
|
||||||
|
|
||||||
func reset() -> void:
|
func reset() -> void:
|
||||||
if tween: tween.kill()
|
if tween: tween.kill()
|
||||||
for child in get_children(true):
|
subway.global_position = origination.global_position
|
||||||
if not child.visible: continue
|
|
||||||
child.global_position = origination.global_position
|
|
||||||
|
|
||||||
func _seat_player_if_inside() -> bool:
|
func _seat_player_if_inside() -> bool:
|
||||||
if %EntryDetect.overlaps_body(State.player):
|
if %EntryDetect.overlaps_body(State.player):
|
||||||
prints("Player departs inside Train", self.name)
|
prints("Player departs inside Train", self.name)
|
||||||
#State.player.sleeping = true
|
|
||||||
var s1 := %Seat1
|
|
||||||
var s2 := %Seat2
|
|
||||||
|
|
||||||
var seat : Node3D = s1 if (s1.global_position-State.player.global_position).length() < (s2.global_position-State.player.global_position).length() else s2
|
State.player.reparent(subway)
|
||||||
State.player.reparent(seat)
|
|
||||||
return true
|
return true
|
||||||
return false
|
return false
|
||||||
|
|
||||||
|
|
@ -51,8 +45,6 @@ func _seat_player_if_inside() -> bool:
|
||||||
func _unseat_player_if_inside() -> void:
|
func _unseat_player_if_inside() -> void:
|
||||||
if %EntryDetect.overlaps_body(State.player):
|
if %EntryDetect.overlaps_body(State.player):
|
||||||
prints("Player arrives on Train", self.name)
|
prints("Player arrives on Train", self.name)
|
||||||
|
|
||||||
#State.player.sleeping = false
|
|
||||||
State.player.reparent(get_parent())
|
State.player.reparent(get_parent())
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -62,9 +54,7 @@ func arrive() -> void:
|
||||||
await get_tree().create_timer(pre_arrival_time).timeout
|
await get_tree().create_timer(pre_arrival_time).timeout
|
||||||
if tween: tween.kill()
|
if tween: tween.kill()
|
||||||
tween = create_tween().set_trans(Tween.TRANS_CIRC).set_ease(Tween.EASE_OUT)
|
tween = create_tween().set_trans(Tween.TRANS_CIRC).set_ease(Tween.EASE_OUT)
|
||||||
for child in get_children(true):
|
tween.parallel().tween_property(subway, "global_position", self.global_position, arrival_time)
|
||||||
if not child.visible: continue
|
|
||||||
tween.parallel().tween_property(child, "global_position", self.global_position, arrival_time)
|
|
||||||
await tween.finished
|
await tween.finished
|
||||||
subway.door_open = true
|
subway.door_open = true
|
||||||
_unseat_player_if_inside()
|
_unseat_player_if_inside()
|
||||||
|
|
@ -77,9 +67,7 @@ func leave() -> void:
|
||||||
var seated := _seat_player_if_inside()
|
var seated := _seat_player_if_inside()
|
||||||
if tween: tween.kill()
|
if tween: tween.kill()
|
||||||
tween = create_tween().set_trans(Tween.TRANS_QUART).set_ease(Tween.EASE_IN)
|
tween = create_tween().set_trans(Tween.TRANS_QUART).set_ease(Tween.EASE_IN)
|
||||||
for child in get_children(true):
|
tween.parallel().tween_property(subway, "global_position", destination.global_position, leave_time)
|
||||||
if not child.visible: continue
|
|
||||||
tween.parallel().tween_property(child, "global_position", destination.global_position, leave_time)
|
|
||||||
await tween.finished
|
await tween.finished
|
||||||
await %SubwayTrainAudio.finished
|
await %SubwayTrainAudio.finished
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,12 +6,12 @@ class_name SubwayTrain
|
||||||
if door_open == open: return
|
if door_open == open: return
|
||||||
door_open=open
|
door_open=open
|
||||||
if open:
|
if open:
|
||||||
$Subway/AnimationPlayer.play("door_open")
|
%TrainModel/AnimationPlayer.play("door_open")
|
||||||
else:
|
else:
|
||||||
$Subway/AnimationPlayer.play("door_close")
|
%TrainModel/AnimationPlayer.play("door_close")
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
$Subway/AnimationPlayer.animation_finished.connect(_on_animation_finished)
|
%TrainModel/AnimationPlayer.animation_finished.connect(_on_animation_finished)
|
||||||
|
|
||||||
func _on_animation_finished(_discard) -> void:
|
func _on_animation_finished(_discard) -> void:
|
||||||
%FrontWallClosed.disabled = door_open
|
%FrontWallClosed.disabled = door_open
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ glow_bloom = 0.2
|
||||||
glow_hdr_threshold = 0.5
|
glow_hdr_threshold = 0.5
|
||||||
glow_hdr_luminance_cap = 50.0
|
glow_hdr_luminance_cap = 50.0
|
||||||
fog_enabled = true
|
fog_enabled = true
|
||||||
fog_light_color = Color(0.036443412, 0.15397307, 0.18791193, 1)
|
fog_light_color = Color(0.03529412, 0.15294118, 0.1882353, 1)
|
||||||
fog_density = 0.02
|
fog_density = 0.02
|
||||||
fog_height = 0.25
|
fog_height = 0.25
|
||||||
fog_height_density = 0.5
|
fog_height_density = 0.5
|
||||||
|
|
@ -212,6 +212,7 @@ unique_name_in_owner = true
|
||||||
[node name="PlayerController" parent="Logic" instance=ExtResource("2_il5go")]
|
[node name="PlayerController" parent="Logic" instance=ExtResource("2_il5go")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.0218763, 6.1035156e-05, -5.6086483)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.0218763, 6.1035156e-05, -5.6086483)
|
||||||
|
continuous_cd = true
|
||||||
initial_pitch = -30.0
|
initial_pitch = -30.0
|
||||||
|
|
||||||
[node name="Track0Dolly" parent="Logic" instance=ExtResource("17_yfan7")]
|
[node name="Track0Dolly" parent="Logic" instance=ExtResource("17_yfan7")]
|
||||||
|
|
@ -470,6 +471,7 @@ render_target_update_mode = 4
|
||||||
|
|
||||||
[node name="World Boundary (Floor)" type="CollisionShape3D" parent="Logic/Collision"]
|
[node name="World Boundary (Floor)" type="CollisionShape3D" parent="Logic/Collision"]
|
||||||
shape = SubResource("WorldBoundaryShape3D_rkl48")
|
shape = SubResource("WorldBoundaryShape3D_rkl48")
|
||||||
|
debug_color = Color(0.5019608, 0.003921569, 0.9607843, 1)
|
||||||
|
|
||||||
[node name="CollisionShape3D3" type="CollisionShape3D" parent="Logic/Collision"]
|
[node name="CollisionShape3D3" type="CollisionShape3D" parent="Logic/Collision"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.143, 1, -66.5)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.143, 1, -66.5)
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,18 @@
|
||||||
[gd_scene load_steps=23 format=3 uid="uid://df3ur5wll8vx7"]
|
[gd_scene load_steps=25 format=3 uid="uid://df3ur5wll8vx7"]
|
||||||
|
|
||||||
[ext_resource type="PackedScene" uid="uid://4j1tlhfm3p40" path="res://base-environments/transition/subway_train.tscn" id="1_2h2xx"]
|
[ext_resource type="PackedScene" uid="uid://4j1tlhfm3p40" path="res://base-environments/transition/subway_train.tscn" id="1_2h2xx"]
|
||||||
[ext_resource type="Script" uid="uid://dgfje4druu3sw" path="res://base-environments/transition/code/dolly.gd" id="1_5jpg8"]
|
[ext_resource type="Script" uid="uid://dgfje4druu3sw" path="res://base-environments/transition/code/dolly.gd" id="1_5jpg8"]
|
||||||
[ext_resource type="Script" uid="uid://cyohujvfoiof7" path="res://base-environments/transition/code/subway_train.gd" id="2_aacjs"]
|
[ext_resource type="Script" uid="uid://cyohujvfoiof7" path="res://base-environments/transition/code/subway_train.gd" id="2_aacjs"]
|
||||||
[ext_resource type="AudioStream" uid="uid://cwfr6sgcwg7sl" path="res://base-environments/transition/audio/450918__kyles__metro-subway-montreal-verdun-station-arrive-and-leave-semidistant-from-bridge-over-tracks-overpass.ogg" id="3_4h0n7"]
|
[ext_resource type="AudioStream" uid="uid://cwfr6sgcwg7sl" path="res://base-environments/transition/audio/450918__kyles__metro-subway-montreal-verdun-station-arrive-and-leave-semidistant-from-bridge-over-tracks-overpass.ogg" id="3_4h0n7"]
|
||||||
|
|
||||||
|
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_aacjs"]
|
||||||
|
shading_mode = 0
|
||||||
|
albedo_color = Color(0.03529412, 0.15294118, 0.1882353, 1)
|
||||||
|
|
||||||
|
[sub_resource type="BoxMesh" id="BoxMesh_aacjs"]
|
||||||
|
material = SubResource("StandardMaterial3D_aacjs")
|
||||||
|
size = Vector3(1, 50, 150)
|
||||||
|
|
||||||
[sub_resource type="Shader" id="Shader_tpaj8"]
|
[sub_resource type="Shader" id="Shader_tpaj8"]
|
||||||
code = "shader_type spatial;
|
code = "shader_type spatial;
|
||||||
render_mode depth_prepass_alpha;
|
render_mode depth_prepass_alpha;
|
||||||
|
|
@ -77,90 +85,62 @@ shader_parameter/vertical_emission = SubResource("GradientTexture1D_v43sq")
|
||||||
|
|
||||||
[sub_resource type="QuadMesh" id="QuadMesh_ppxbm"]
|
[sub_resource type="QuadMesh" id="QuadMesh_ppxbm"]
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_5jpg8"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_j8pin"]
|
||||||
size = Vector3(1.565918, 2.3292236, 3.8251343)
|
size = Vector3(30.020142, 3.5859985, 3.5711975)
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_e1qmr"]
|
|
||||||
size = Vector3(30.492157, 4.4813232, 3.4832764)
|
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_aacjs"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_aacjs"]
|
||||||
size = Vector3(31.245972, 4.7752075, 1)
|
size = Vector3(31.245972, 4.7752075, 1)
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_4h0n7"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_4h0n7"]
|
||||||
size = Vector3(16.285, 4.775, 3)
|
size = Vector3(16.285, 4.775, 1)
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_xhnml"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_xhnml"]
|
||||||
size = Vector3(6.041, 4.775, 3)
|
size = Vector3(6.041, 4.775, 1)
|
||||||
|
|
||||||
[sub_resource type="BoxShape3D" id="BoxShape3D_5b47p"]
|
[sub_resource type="BoxShape3D" id="BoxShape3D_5b47p"]
|
||||||
size = Vector3(5.908, 4.775, 3)
|
size = Vector3(5.908, 4.775, 1)
|
||||||
|
|
||||||
[sub_resource type="SphereShape3D" id="SphereShape3D_5jpg8"]
|
[sub_resource type="SphereShape3D" id="SphereShape3D_5jpg8"]
|
||||||
radius = 2.0
|
radius = 2.0
|
||||||
|
|
||||||
|
[sub_resource type="BoxShape3D" id="BoxShape3D_q8slu"]
|
||||||
|
size = Vector3(31.194, 0.8, 3.8)
|
||||||
|
|
||||||
[node name="TrainDolly" type="Node3D"]
|
[node name="TrainDolly" type="Node3D"]
|
||||||
script = ExtResource("1_5jpg8")
|
script = ExtResource("1_5jpg8")
|
||||||
metadata/_custom_type_script = "uid://dgfje4druu3sw"
|
metadata/_custom_type_script = "uid://dgfje4druu3sw"
|
||||||
|
|
||||||
[node name="Destination" type="Node3D" parent="."]
|
[node name="Destination" type="Node3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 150)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 150)
|
||||||
visible = false
|
|
||||||
|
[node name="PotemkinsFacade" type="MeshInstance3D" parent="Destination"]
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -6.2, 0, 0)
|
||||||
|
mesh = SubResource("BoxMesh_aacjs")
|
||||||
|
|
||||||
[node name="Origination" type="Node3D" parent="."]
|
[node name="Origination" type="Node3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -150)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, -150)
|
||||||
visible = false
|
|
||||||
|
|
||||||
[node name="Train" type="AnimatableBody3D" parent="."]
|
[node name="Subway" type="Node3D" parent="."]
|
||||||
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0, 0, 0)
|
|
||||||
script = ExtResource("2_aacjs")
|
script = ExtResource("2_aacjs")
|
||||||
|
metadata/_custom_type_script = "uid://cyohujvfoiof7"
|
||||||
|
|
||||||
[node name="ParticleScreen" type="MeshInstance3D" parent="Train"]
|
[node name="WarpEffecScreen" type="MeshInstance3D" parent="Subway"]
|
||||||
transform = Transform3D(-42.01, 4.0756225e-07, 4.340116e-07, -6.330816e-06, -2.8743172, -0.1808367, -5.9450595e-06, 0.1808367, -2.8743172, -3.9468384, 1.286, 2.488358)
|
transform = Transform3D(-4.108744e-06, 0.1808367, -2.8743172, -6.330816e-06, -2.8743172, -0.1808367, 42.01, -4.1546687e-07, -3.0837123e-07, 2.4883583, 1.286, 3.9468384)
|
||||||
visible = false
|
|
||||||
material_override = SubResource("ShaderMaterial_0vobo")
|
material_override = SubResource("ShaderMaterial_0vobo")
|
||||||
mesh = SubResource("QuadMesh_ppxbm")
|
mesh = SubResource("QuadMesh_ppxbm")
|
||||||
|
skeleton = NodePath("../Collider")
|
||||||
|
|
||||||
[node name="Subway" parent="Train" instance=ExtResource("1_2h2xx")]
|
[node name="EntryDetect" type="Area3D" parent="Subway"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.7804413, 0, 0)
|
|
||||||
script = null
|
|
||||||
|
|
||||||
[node name="EntryDetect" type="Area3D" parent="Train"]
|
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0, 0, 0)
|
||||||
|
|
||||||
[node name="EntryShape1" type="CollisionShape3D" parent="Train/EntryDetect"]
|
[node name="InteriorTriggerShape" type="CollisionShape3D" parent="Subway/EntryDetect"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -8.105429, 1.1704571, 0.0023494991)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.7977905, 1.3545837, -0.13719177)
|
||||||
shape = SubResource("BoxShape3D_5jpg8")
|
shape = SubResource("BoxShape3D_j8pin")
|
||||||
|
debug_color = Color(0.7607843, 0.8117647, 0, 0.7176471)
|
||||||
|
|
||||||
[node name="Seat1" type="Node3D" parent="Train/EntryDetect/EntryShape1"]
|
[node name="SpotLight3D" type="SpotLight3D" parent="Subway"]
|
||||||
unique_name_in_owner = true
|
transform = Transform3D(-0.9620134, -0.0361063, -0.27060416, -2.0788793e-10, 0.9912155, -0.13225639, 0.27300233, -0.12723242, -0.9535627, -1.7471651, 0.40866053, 14.344355)
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00042915344, -1.042389, 3.5422485e-07)
|
|
||||||
|
|
||||||
[node name="EntryShape2" type="CollisionShape3D" parent="Train/EntryDetect"]
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 9.689882, 1.1704571, 4.236329e-07)
|
|
||||||
shape = SubResource("BoxShape3D_5jpg8")
|
|
||||||
|
|
||||||
[node name="Seat2" type="Node3D" parent="Train/EntryDetect/EntryShape2"]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.00042915344, -1.042389, 3.5422485e-07)
|
|
||||||
|
|
||||||
[node name="SubwayTrainAudio" type="AudioStreamPlayer3D" parent="Train"]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
stream = ExtResource("3_4h0n7")
|
|
||||||
unit_size = 100.0
|
|
||||||
panning_strength = 0.7
|
|
||||||
bus = &"sfx"
|
|
||||||
playback_type = 1
|
|
||||||
|
|
||||||
[node name="SubwayTrainAudioIntense" type="AudioStreamPlayer3D" parent="Train"]
|
|
||||||
unique_name_in_owner = true
|
|
||||||
stream = ExtResource("3_4h0n7")
|
|
||||||
attenuation_model = 1
|
|
||||||
unit_size = 15.0
|
|
||||||
bus = &"sfx"
|
|
||||||
playback_type = 1
|
|
||||||
|
|
||||||
[node name="SpotLight3D" type="SpotLight3D" parent="Train"]
|
|
||||||
transform = Transform3D(-0.2730023, 0.12723242, 0.9535627, -2.0788793e-10, 0.9912155, -0.13225639, -0.9620134, -0.036106296, -0.27060413, -14.344355, 0.40866053, -1.7471657)
|
|
||||||
light_energy = 5.0
|
light_energy = 5.0
|
||||||
light_specular = 0.0
|
light_specular = 0.0
|
||||||
light_bake_mode = 0
|
light_bake_mode = 0
|
||||||
|
|
@ -170,39 +150,71 @@ spot_range = 200.0
|
||||||
spot_attenuation = 0.2
|
spot_attenuation = 0.2
|
||||||
spot_angle = 15.0
|
spot_angle = 15.0
|
||||||
|
|
||||||
[node name="SubwaySoundAttenuationArea" type="Area3D" parent="Train"]
|
[node name="SubwayTrainAudio" type="AudioStreamPlayer3D" parent="Subway"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0, 0, 0)
|
||||||
|
stream = ExtResource("3_4h0n7")
|
||||||
|
unit_size = 100.0
|
||||||
|
panning_strength = 0.7
|
||||||
|
bus = &"sfx"
|
||||||
|
playback_type = 1
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Train/SubwaySoundAttenuationArea"]
|
[node name="SubwayTrainAudioIntense" type="AudioStreamPlayer3D" parent="Subway"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.6517792, 1.7406616, 0.034606963)
|
unique_name_in_owner = true
|
||||||
shape = SubResource("BoxShape3D_e1qmr")
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0, 0, 0)
|
||||||
|
stream = ExtResource("3_4h0n7")
|
||||||
|
attenuation_model = 1
|
||||||
|
unit_size = 15.0
|
||||||
|
bus = &"sfx"
|
||||||
|
playback_type = 1
|
||||||
|
|
||||||
[node name="FrontWallClosed" type="CollisionShape3D" parent="Train"]
|
[node name="TrainModel" parent="Subway" instance=ExtResource("1_2h2xx")]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, -3.4114173e-08, 0, -0.7804413)
|
||||||
|
script = null
|
||||||
|
|
||||||
|
[node name="Collider" type="AnimatableBody3D" parent="Subway"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
transform = Transform3D(-4.371139e-08, 0, 1, 0, 1, 0, -1, 0, -4.371139e-08, 0, 0, 0)
|
||||||
|
input_ray_pickable = false
|
||||||
|
axis_lock_angular_x = true
|
||||||
|
axis_lock_angular_y = true
|
||||||
|
axis_lock_angular_z = true
|
||||||
|
sync_to_physics = false
|
||||||
|
|
||||||
|
[node name="FrontWallClosed" type="CollisionShape3D" parent="Subway/Collider"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.8395386, 1.4940796, -1.533)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.8395386, 1.4940796, -1.533)
|
||||||
shape = SubResource("BoxShape3D_aacjs")
|
shape = SubResource("BoxShape3D_aacjs")
|
||||||
|
|
||||||
[node name="FrontWallOpen1" type="CollisionShape3D" parent="Train"]
|
[node name="FrontWallOpen1" type="CollisionShape3D" parent="Subway/Collider"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.80548847, 1.4940796, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.8054885, 1.4940796, -1.4447353)
|
||||||
shape = SubResource("BoxShape3D_4h0n7")
|
shape = SubResource("BoxShape3D_4h0n7")
|
||||||
|
|
||||||
[node name="FrontWallOpen2" type="CollisionShape3D" parent="Train"]
|
[node name="FrontWallOpen2" type="CollisionShape3D" parent="Subway/Collider"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 13.442047, 1.4940796, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 13.442047, 1.4940796, -1.4447353)
|
||||||
shape = SubResource("BoxShape3D_xhnml")
|
shape = SubResource("BoxShape3D_xhnml")
|
||||||
|
|
||||||
[node name="FrontWallOpen3" type="CollisionShape3D" parent="Train"]
|
[node name="FrontWallOpen3" type="CollisionShape3D" parent="Subway/Collider"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.829376, 1.4940796, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -11.829376, 1.4940796, -1.4447353)
|
||||||
shape = SubResource("BoxShape3D_5b47p")
|
shape = SubResource("BoxShape3D_5b47p")
|
||||||
|
|
||||||
[node name="RearWall" type="CollisionShape3D" parent="Train"]
|
[node name="RearWall" type="CollisionShape3D" parent="Subway/Collider"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.344, 1.457)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.344, 1.457)
|
||||||
shape = SubResource("BoxShape3D_aacjs")
|
shape = SubResource("BoxShape3D_aacjs")
|
||||||
|
|
||||||
[node name="DriverCabin1" type="CollisionShape3D" parent="Train"]
|
[node name="DriverCabin1" type="CollisionShape3D" parent="Subway/Collider"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 15.448963, 1.0697384, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 15.448963, 1.0697384, 0)
|
||||||
shape = SubResource("SphereShape3D_5jpg8")
|
shape = SubResource("SphereShape3D_5jpg8")
|
||||||
disabled = true
|
debug_color = Color(0, 0.46666667, 0.54901963, 0.9254902)
|
||||||
|
|
||||||
[node name="DriverCabin2" type="CollisionShape3D" parent="Train"]
|
[node name="DriverCabin2" type="CollisionShape3D" parent="Subway/Collider"]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13.730333, 1.0697384, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -13.730333, 1.0697384, 0)
|
||||||
shape = SubResource("SphereShape3D_5jpg8")
|
shape = SubResource("SphereShape3D_5jpg8")
|
||||||
disabled = true
|
debug_color = Color(0, 0.46666667, 0.54901963, 0.9254902)
|
||||||
|
|
||||||
|
[node name="TrainFloor" type="CollisionShape3D" parent="Subway/Collider"]
|
||||||
|
unique_name_in_owner = true
|
||||||
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -0.25, 0)
|
||||||
|
shape = SubResource("BoxShape3D_q8slu")
|
||||||
|
debug_color = Color(0.5375858, 0, 0.22143945, 1)
|
||||||
|
|
|
||||||
|
|
@ -173,7 +173,7 @@ var has_entered:bool = false:
|
||||||
delay_passed = false
|
delay_passed = false
|
||||||
var delay_passed:bool = false
|
var delay_passed:bool = false
|
||||||
|
|
||||||
func _on_ray_entered(_area : Area3D):
|
func _on_ray_entered(_area : Area3D) -> void:
|
||||||
var parent := _area.get_parent() as Interactable
|
var parent := _area.get_parent() as Interactable
|
||||||
if not parent.visible: return
|
if not parent.visible: return
|
||||||
assert(parent != null, "Ray entered non-interactable area!")
|
assert(parent != null, "Ray entered non-interactable area!")
|
||||||
|
|
@ -183,7 +183,7 @@ func _on_ray_entered(_area : Area3D):
|
||||||
if hand_cursor:
|
if hand_cursor:
|
||||||
hand_cursor.texture = cursor_point
|
hand_cursor.texture = cursor_point
|
||||||
|
|
||||||
func _on_ray_exited(_area):
|
func _on_ray_exited(_area : Area3D) -> void:
|
||||||
var parent := _area.get_parent() as Interactable
|
var parent := _area.get_parent() as Interactable
|
||||||
if not parent.visible: return
|
if not parent.visible: return
|
||||||
#printt("ray exited", parent.name, parent)
|
#printt("ray exited", parent.name, parent)
|
||||||
|
|
@ -200,7 +200,7 @@ func _physics_process(delta: float):
|
||||||
if jitter_strength > 0 and not State.reduce_motion:
|
if jitter_strength > 0 and not State.reduce_motion:
|
||||||
_handle_jitter(delta)
|
_handle_jitter(delta)
|
||||||
|
|
||||||
func _handle_movement(delta:float):
|
func _handle_movement(_delta:float):
|
||||||
var input:Vector2 = Vector2(Input.get_action_strength("player_right") - Input.get_action_strength("player_left"),
|
var input:Vector2 = Vector2(Input.get_action_strength("player_right") - Input.get_action_strength("player_left"),
|
||||||
Input.get_action_strength("player_backwards")*0.8 - Input.get_action_strength("player_forwards"))
|
Input.get_action_strength("player_backwards")*0.8 - Input.get_action_strength("player_forwards"))
|
||||||
|
|
||||||
|
|
@ -211,14 +211,9 @@ func _handle_movement(delta:float):
|
||||||
|
|
||||||
direction = yaw.global_transform.basis.x * direction.x + transform.basis.y * direction.y + yaw.global_transform.basis.z * direction.z
|
direction = yaw.global_transform.basis.x * direction.x + transform.basis.y * direction.y + yaw.global_transform.basis.z * direction.z
|
||||||
|
|
||||||
if linear_velocity.length() > (linear_velocity + (direction*max_speed - linear_velocity)).length():
|
|
||||||
direction = Vector3.ZERO
|
|
||||||
else:
|
|
||||||
direction *= (direction*max_speed - linear_velocity).length()*max_acceleration
|
|
||||||
|
|
||||||
linear_damp = damp * max(0.5, 1 - input.length())
|
linear_damp = damp * max(0.5, 1 - input.length())
|
||||||
|
|
||||||
apply_central_impulse(direction*delta)
|
apply_central_force(direction*max_acceleration)
|
||||||
|
|
||||||
func _handle_rotation(delta:float):
|
func _handle_rotation(delta:float):
|
||||||
var smoothness = min(3, 60.0/Engine.get_frames_per_second())
|
var smoothness = min(3, 60.0/Engine.get_frames_per_second())
|
||||||
|
|
|
||||||
|
|
@ -619,6 +619,7 @@ axis_lock_angular_z = true
|
||||||
physics_material_override = SubResource("10")
|
physics_material_override = SubResource("10")
|
||||||
can_sleep = false
|
can_sleep = false
|
||||||
script = ExtResource("1_0b4mi")
|
script = ExtResource("1_0b4mi")
|
||||||
|
max_acceleration = 7.0
|
||||||
|
|
||||||
[node name="ShadowCaster" type="MeshInstance3D" parent="."]
|
[node name="ShadowCaster" type="MeshInstance3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.54540473, 0)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.54540473, 0)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue