Fix dreamer body rotation
This commit is contained in:
parent
01cf02eb8a
commit
4778c4c70a
2 changed files with 14 additions and 5 deletions
|
|
@ -20,6 +20,10 @@ config/icon="res://icon.svg"
|
||||||
Global="*uid://4hvgybxt05qj"
|
Global="*uid://4hvgybxt05qj"
|
||||||
LimboConsole="*uid://dyxornv8vwibg"
|
LimboConsole="*uid://dyxornv8vwibg"
|
||||||
|
|
||||||
|
[display]
|
||||||
|
|
||||||
|
window/size/sharp_corners=true
|
||||||
|
|
||||||
[editor]
|
[editor]
|
||||||
|
|
||||||
movie_writer/movie_file="/home/lukas/Videos/movie/movie.avi"
|
movie_writer/movie_file="/home/lukas/Videos/movie/movie.avi"
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ func _physics_process(delta: float) -> void:
|
||||||
velocity.y = JUMP_VELOCITY
|
velocity.y = JUMP_VELOCITY
|
||||||
$DreamerBody/Animator.set("parameters/jump/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE)
|
$DreamerBody/Animator.set("parameters/jump/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE)
|
||||||
|
|
||||||
var direction = Vector2.ZERO
|
var direction = Vector3.ZERO
|
||||||
|
|
||||||
state_timer -= delta
|
state_timer -= delta
|
||||||
|
|
||||||
|
|
@ -155,9 +155,14 @@ func _physics_process(delta: float) -> void:
|
||||||
if state_timer <= 0:
|
if state_timer <= 0:
|
||||||
state = STATE_APPROACH_ENEMY
|
state = STATE_APPROACH_ENEMY
|
||||||
|
|
||||||
if direction.x > 0:
|
var camera_right = game.get_node("PlayerCamera").global_transform.basis.x
|
||||||
|
|
||||||
|
if typeof(camera_right) == TYPE_VECTOR3:
|
||||||
|
var dot_direction = direction.dot(camera_right)
|
||||||
|
|
||||||
|
if dot_direction > 0:
|
||||||
face_left = false
|
face_left = false
|
||||||
if direction.x < 0:
|
if dot_direction < 0:
|
||||||
face_left = true
|
face_left = true
|
||||||
|
|
||||||
if direction and (knockback_time <= 0):
|
if direction and (knockback_time <= 0):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue