Fix FPS Tutorial move_and_slide

This commit is contained in:
Matthew Ehrenhofler
2018-07-08 21:44:44 -04:00
parent 0327dfe4da
commit fad1c8397b

View File

@@ -145,7 +145,7 @@ Add the following code to ``Player.gd``:
var vel = Vector3()
const MAX_SPEED = 20
const JUMP_SPEED = 18
const ACCEL= 4.5
const ACCEL = 4.5
var dir = Vector3()
@@ -228,7 +228,7 @@ Add the following code to ``Player.gd``:
hvel = hvel.linear_interpolate(target, accel*delta)
vel.x = hvel.x
vel.z = hvel.z
vel = move_and_slide(vel,Vector3(0,1,0), true, 0.05, 4, deg2rad(MAX_SLOPE_ANGLE))
vel = move_and_slide(vel,Vector3(0,1,0), 0.05, 4, deg2rad(MAX_SLOPE_ANGLE))
func _input(event):
if event is InputEventMouseMotion and Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED: