rudimentary clamber
This commit is contained in:
@@ -1,11 +1,22 @@
|
||||
extends PlayerState
|
||||
class_name PlayerOnLadder
|
||||
|
||||
var climbing_started = false
|
||||
|
||||
func Enter():
|
||||
climbing_started = false
|
||||
|
||||
func Physics_Update(delta):
|
||||
character.global_position.x = lerp(character.global_position.x,character.current_ladder.global_position.x,delta * 8)
|
||||
character.global_position.z = lerp(character.global_position.z,character.current_ladder.global_position.z,delta * 8)
|
||||
|
||||
ladder_movement(delta)
|
||||
|
||||
if !character.is_on_floor() and !climbing_started:
|
||||
climbing_started = true
|
||||
|
||||
if character.is_on_floor() and climbing_started:
|
||||
Transitioned.emit(self, "on foot")
|
||||
|
||||
func ladder_movement(delta):
|
||||
var direction = Input.get_vector("move_down","move_up","move_left","move_right").x
|
||||
|
||||
Reference in New Issue
Block a user