Skip to content
Snippets Groups Projects
Commit 1cb5af79 authored by Canopteks's avatar Canopteks
Browse files

physics sync

parent ce24bb0b
Branches
Tags
No related merge requests found
...@@ -25,4 +25,4 @@ func _ready(): ...@@ -25,4 +25,4 @@ func _ready():
player = $KinematicBody player = $KinematicBody
remote func getRemoteMovement(position): remote func getRemoteMovement(position):
player.move_and_slide(position, Vector3(0,1,0), 0.05, 4, deg2rad(MAX_SLOPE_ANGLE)) player.move_and_slide(position, Vector3(0,1,0), 0.05, 1, deg2rad(MAX_SLOPE_ANGLE))
\ No newline at end of file \ No newline at end of file
...@@ -16,12 +16,10 @@ script = ExtResource( 1 ) ...@@ -16,12 +16,10 @@ script = ExtResource( 1 )
[node name="Body_CollisionShape" type="CollisionShape" parent="KinematicBody"] [node name="Body_CollisionShape" type="CollisionShape" parent="KinematicBody"]
transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.585563, 0 ) transform = Transform( 1, 0, 0, 0, -4.37114e-08, -1, 0, 1, -4.37114e-08, 0, 0.585563, 0 )
shape = SubResource( 1 ) shape = SubResource( 1 )
disabled = true
[node name="Feet_CollisionShape" type="CollisionShape" parent="KinematicBody"] [node name="Feet_CollisionShape" type="CollisionShape" parent="KinematicBody"]
transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.131137, 0 ) transform = Transform( 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.131137, 0 )
shape = SubResource( 2 ) shape = SubResource( 2 )
disabled = true
[node name="Model" type="Spatial" parent="KinematicBody"] [node name="Model" type="Spatial" parent="KinematicBody"]
......
...@@ -3,7 +3,7 @@ extends Node ...@@ -3,7 +3,7 @@ extends Node
const GAMEPATH = "/root/game" const GAMEPATH = "/root/game"
const PORT = 10001 const PORT = 10001
const MAX_CLIENTS = 1 const MAX_CLIENTS = 2
var players = {} var players = {}
......
...@@ -14,6 +14,7 @@ const MAX_SPRINT_SPEED:float = 12.0 ...@@ -14,6 +14,7 @@ const MAX_SPRINT_SPEED:float = 12.0
var isSprinting:bool = false var isSprinting:bool = false
const JUMP_SPEED:float = 16.0 const JUMP_SPEED:float = 16.0
var isJumping:bool = false
# TODO: unreal, try to understand that, genius # TODO: unreal, try to understand that, genius
const GRAVITY:float = -28.0 const GRAVITY:float = -28.0
...@@ -40,6 +41,7 @@ func getPlayerInputs(movementInput, sprintInput, jumpInput): ...@@ -40,6 +41,7 @@ func getPlayerInputs(movementInput, sprintInput, jumpInput):
motion.z = 0 motion.z = 0
isSprinting = sprintInput isSprinting = sprintInput
isJumping = jumpInput
if player.is_on_floor()||player.is_on_wall(): if player.is_on_floor()||player.is_on_wall():
if jumpInput: if jumpInput:
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment