diff --git a/Assets/Enemy/Gun.prefab b/Assets/Enemy/Gun.prefab index bf59172..26cdb17 100644 --- a/Assets/Enemy/Gun.prefab +++ b/Assets/Enemy/Gun.prefab @@ -30,7 +30,7 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 2.2222223, y: 2.2222223, z: 2.2222223} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} diff --git a/Assets/Enemy/GunThrower.prefab b/Assets/Enemy/GunThrower.prefab index 6b4776f..e2565a2 100644 --- a/Assets/Enemy/GunThrower.prefab +++ b/Assets/Enemy/GunThrower.prefab @@ -52,7 +52,7 @@ MonoBehaviour: damageTimeoutSeconds: 0.5 health: 10 gun: {fileID: 5213001249979318174, guid: 98b57b15498e96a9c8fe56264ac2ef63, type: 3} - throwSpeed: 0 + throwSpeed: 41.61 --- !u!212 &480941680556316754 SpriteRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts C#/Ratbots/GunThrower.cs b/Assets/Scripts C#/Ratbots/GunThrower.cs index 1b6a66c..c6d3e8c 100644 --- a/Assets/Scripts C#/Ratbots/GunThrower.cs +++ b/Assets/Scripts C#/Ratbots/GunThrower.cs @@ -15,9 +15,13 @@ public class GunThrower : Ratbot } void ThrowGun() { - GameObject thrown = Instantiate(gun); + GameObject thrown = Instantiate( + gun, + transform.position, + Quaternion.identity + ); thrown.GetComponent().AddRelativeForce(( - transform.position - player.transform.position + player.transform.position - thrown.transform.position ).normalized * throwSpeed); thrown.GetComponent().damageStrength = damageStrength; }