diff --git a/unity/Assets/2.5D Engine/Scripts/ProjectileShooter.cs b/unity/Assets/2.5D Engine/Scripts/ProjectileShooter.cs index 10af82f..260cd5e 100644 --- a/unity/Assets/2.5D Engine/Scripts/ProjectileShooter.cs +++ b/unity/Assets/2.5D Engine/Scripts/ProjectileShooter.cs @@ -28,9 +28,9 @@ namespace IndianOceanAssets.Engine2_5D // Flip shooter sprite based on target direction if (hit.point.x > transform.position.x) - transform.localScale = new Vector3(1, 1, 1); + transform.localScale = new Vector3(Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z); else - transform.localScale = new Vector3(-1, 1, 1); + transform.localScale = new Vector3(-Mathf.Abs(transform.localScale.x), transform.localScale.y, transform.localScale.z); } } } diff --git a/unity/Assets/Scenes/Test.unity b/unity/Assets/Scenes/Test.unity index 429742a..1c9ea3b 100644 --- a/unity/Assets/Scenes/Test.unity +++ b/unity/Assets/Scenes/Test.unity @@ -469,6 +469,18 @@ PrefabInstance: propertyPath: m_Sprite value: objectReference: {fileID: 21300000, guid: 65c67fef26e92dc468f154fb308d155a, type: 3} + - target: {fileID: 3732617863691343031, guid: caf051d43a1fd9344a29f0c7376bbf5f, type: 3} + propertyPath: m_LocalScale.x + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 3732617863691343031, guid: caf051d43a1fd9344a29f0c7376bbf5f, type: 3} + propertyPath: m_LocalScale.y + value: 0.5 + objectReference: {fileID: 0} + - target: {fileID: 3732617863691343031, guid: caf051d43a1fd9344a29f0c7376bbf5f, type: 3} + propertyPath: m_LocalScale.z + value: 0.5 + objectReference: {fileID: 0} - target: {fileID: 3732617863691343031, guid: caf051d43a1fd9344a29f0c7376bbf5f, type: 3} propertyPath: m_LocalPosition.x value: 0