using UnityEngine; public class Ballgun : Tool { [Header("Ball Gun Parameters")] public float shootForce = 10; public GameObject ball; public float ballLifeTime = 5; public override void Use() { GameObject newBall = Instantiate(ball); newBall.transform.position = transform.position; Vector3 direction = transform.forward * shootForce; direction += GameManager.Instance.GetPlayerController().GetVelocity(); newBall.GetComponent().AddForce(direction, ForceMode.Impulse); Destroy(newBall, ballLifeTime); } public override void UseAlt() { throw new System.NotImplementedException(); } }