Attention | Topic was automatically imported from the old Question2Answer platform. | |
Asked By | James122333 |
ar gravity = 9.8
var location = Vector3()
var capncrunch = Vector3()
export var speed = 7
export var jump_height = 9
var velocity = Vector3()
func get_input():
velocity = Vector3()
if Input.is_action_pressed(‘ui_right’):
velocity.x += 1
if Input.is_action_pressed(‘ui_left’):
velocity.x -= 1
if Input.is_action_pressed(“ui_forward”):
velocity.z -= 1
if Input.is_action_pressed(“ui_backwards”):
velocity.z += 1
velocity = velocity.normalized() * speed
func _physics_process(delta):
get_input()
velocity = move_and_slide(velocity)
move_and_slide(global_transform.basis.xform(capncrunch), Vector3.UP)
if Input.is_action_just_pressed("jump"):
if is_on_floor():
capncrunch.y = jump_height
if not is_on_floor():
capncrunch.y -= gravity * delta
Means do you want to make a fps type game in Godot?
Then you can search for Garbaj fps series. It will teach you
how to make a fps in Godot.
Dinoking | 2020-11-20 04:22