Only use look_dir for ori when wielded or attacking

This commit is contained in:
timokoesters 2019-08-25 12:10:42 +02:00
parent 295969517c
commit 62745c4cad
No known key found for this signature in database
GPG Key ID: CD80BE9AAEE78097

View File

@ -94,10 +94,10 @@ impl<'a> System<'a> for Sys {
};
// Set direction based on move direction when on the ground
let ori_dir = if character.movement == Glide || character.movement.is_roll() {
Vec2::from(vel.0)
} else {
let ori_dir = if character.action.is_wield() || character.action.is_attack() {
Vec2::from(controller.look_dir).normalized()
} else {
Vec2::from(vel.0)
};
if ori_dir.magnitude_squared() > 0.0001