Some changes
This commit is contained in:
parent
1f1f2918c9
commit
5866eb267e
@ -85,9 +85,15 @@ crouch={
|
|||||||
|
|
||||||
[physics]
|
[physics]
|
||||||
|
|
||||||
|
common/physics_ticks_per_second=120
|
||||||
|
3d/physics_engine="GodotPhysics3D"
|
||||||
3d/default_gravity=15.0
|
3d/default_gravity=15.0
|
||||||
|
|
||||||
[rendering]
|
[rendering]
|
||||||
|
|
||||||
anti_aliasing/quality/msaa_3d=1
|
anti_aliasing/quality/msaa_3d=1
|
||||||
anti_aliasing/quality/screen_space_aa=1
|
anti_aliasing/quality/screen_space_aa=1
|
||||||
|
|
||||||
|
[xr]
|
||||||
|
|
||||||
|
openxr/physics_ticks_per_second=60
|
||||||
|
@ -20,7 +20,7 @@ collision_layer = 9
|
|||||||
collision_mask = 9
|
collision_mask = 9
|
||||||
script = ExtResource("1_q75ai")
|
script = ExtResource("1_q75ai")
|
||||||
|
|
||||||
[node name="Collision" type="CollisionShape3D" parent="."]
|
[node name="MainCollision" type="CollisionShape3D" parent="."]
|
||||||
shape = SubResource("CapsuleShape3D_jc50w")
|
shape = SubResource("CapsuleShape3D_jc50w")
|
||||||
|
|
||||||
[node name="PlayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
|
[node name="PlayerSynchronizer" type="MultiplayerSynchronizer" parent="."]
|
||||||
|
@ -14,7 +14,7 @@ var mouse_captured: bool = false
|
|||||||
@onready var first_view_camera_mount: Node3D = $FirstPersonCameraMount
|
@onready var first_view_camera_mount: Node3D = $FirstPersonCameraMount
|
||||||
@onready var first_view_camera: Camera3D = $FirstPersonCameraMount/Camera
|
@onready var first_view_camera: Camera3D = $FirstPersonCameraMount/Camera
|
||||||
@onready var model_mount: Node3D = $ModelMount
|
@onready var model_mount: Node3D = $ModelMount
|
||||||
|
@onready var main_collision: CollisionShape3D = $MainCollision
|
||||||
# -- This node is supposed to be spawned per player, and since each
|
# -- This node is supposed to be spawned per player, and since each
|
||||||
# -- player has an id, it is used for giving a node a name. So we can
|
# -- player has an id, it is used for giving a node a name. So we can
|
||||||
# -- use it here to tell a controlled node from the rest models
|
# -- use it here to tell a controlled node from the rest models
|
||||||
@ -52,9 +52,16 @@ func _add_world_model() -> Error :
|
|||||||
if not ResourceLoader.exists(path):
|
if not ResourceLoader.exists(path):
|
||||||
return ERR_DOES_NOT_EXIST
|
return ERR_DOES_NOT_EXIST
|
||||||
var scene: PackedScene = ResourceLoader.load(path)
|
var scene: PackedScene = ResourceLoader.load(path)
|
||||||
|
|
||||||
|
var lowest_local_point = Vector3.ZERO
|
||||||
|
var shape = main_collision.shape
|
||||||
|
var radius = shape.radius
|
||||||
|
var height = shape.height
|
||||||
|
lowest_local_point = Vector3(0, 0.1, 0)
|
||||||
if not scene.can_instantiate():
|
if not scene.can_instantiate():
|
||||||
return ERR_CANT_OPEN
|
return ERR_CANT_OPEN
|
||||||
var node: Node3D = scene.instantiate()
|
var node: Node3D = scene.instantiate()
|
||||||
|
node.position = lowest_local_point
|
||||||
model_mount.add_child(node)
|
model_mount.add_child(node)
|
||||||
return OK
|
return OK
|
||||||
|
|
||||||
@ -114,7 +121,6 @@ func _unhandled_input(event: InputEvent) -> void:
|
|||||||
#if Input.is_action_just_pressed("reload"): $Body/UpperTorso/CameraMount/Camera.reload()
|
#if Input.is_action_just_pressed("reload"): $Body/UpperTorso/CameraMount/Camera.reload()
|
||||||
|
|
||||||
func _rotate_camera(sens_mod: float = 1.0) -> void:
|
func _rotate_camera(sens_mod: float = 1.0) -> void:
|
||||||
#if str($"..".name).to_int() == multiplayer.get_unique_id():
|
|
||||||
rotation.y -= look_dir.x * camera_sens * sens_mod
|
rotation.y -= look_dir.x * camera_sens * sens_mod
|
||||||
first_view_camera_mount.rotation.x = clamp(first_view_camera_mount.rotation.x - look_dir.y * camera_sens * sens_mod, -1.5, 1.5)
|
first_view_camera_mount.rotation.x = clamp(first_view_camera_mount.rotation.x - look_dir.y * camera_sens * sens_mod, -1.5, 1.5)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user