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"
|
||||
LimboConsole="*uid://dyxornv8vwibg"
|
||||
|
||||
[display]
|
||||
|
||||
window/size/sharp_corners=true
|
||||
|
||||
[editor]
|
||||
|
||||
movie_writer/movie_file="/home/lukas/Videos/movie/movie.avi"
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ func _physics_process(delta: float) -> void:
|
|||
velocity.y = JUMP_VELOCITY
|
||||
$DreamerBody/Animator.set("parameters/jump/request", AnimationNodeOneShot.ONE_SHOT_REQUEST_FIRE)
|
||||
|
||||
var direction = Vector2.ZERO
|
||||
var direction = Vector3.ZERO
|
||||
|
||||
state_timer -= delta
|
||||
|
||||
|
|
@ -155,10 +155,15 @@ func _physics_process(delta: float) -> void:
|
|||
if state_timer <= 0:
|
||||
state = STATE_APPROACH_ENEMY
|
||||
|
||||
if direction.x > 0:
|
||||
face_left = false
|
||||
if direction.x < 0:
|
||||
face_left = true
|
||||
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
|
||||
if dot_direction < 0:
|
||||
face_left = true
|
||||
|
||||
if direction and (knockback_time <= 0):
|
||||
velocity.x = direction.x * SPEED
|
||||
|
|
|
|||
Loading…
Reference in a new issue