![]() |
Attention | Topic was automatically imported from the old Question2Answer platform. |
![]() |
Asked By | Miguelxi |
extends KinematicBody
var gravity =Vector3.DOWN * 12
var speed = 4
var jump_speed = 6
var velocity = Vector3()
func _physics_process(delta):
velocity += gravity * delta
get_input()
velocity = move_and_slide(velocity,Vector3.UP)
func get_input():
velocity.x = 0
velocity.z = 0
if Input.is_action_pressed("move_forward"):
velocity.z -= speed
if Input.is_action_pressed("move_back"):
velocity.z -= speed
if Input.is_action_pressed("strafe_right"):
velocity.x -= speed
if Input.is_action_pressed("strafe_left"):
velocity.x -= speed
func _unhandled_input(event):
if event is InputEventMouseMotion:
I am getting a error on line 21 (Error parsing expression, misplaced: func)
I added indentation and there were no extra spaces, Does anybody know how to fix this?