Update iamagun.cs
parent
89b1ba73ee
commit
9525ce625c
|
@ -11,7 +11,7 @@ public class iamagun : MonoBehaviour
|
|||
|
||||
public float kickDuration = 0.1f; // Duration of the kick animation
|
||||
|
||||
private AudioSource audio;
|
||||
private new AudioSource audio;
|
||||
|
||||
private Vector3 offsetPosition;
|
||||
private Quaternion offsetRotation;
|
||||
|
@ -25,6 +25,8 @@ public class iamagun : MonoBehaviour
|
|||
// Flag to check if the kick animation is active
|
||||
private bool isKicking = false;
|
||||
|
||||
private bool isInHand = false;
|
||||
|
||||
// Start is called before the first frame update
|
||||
void Start()
|
||||
{
|
||||
|
@ -38,6 +40,7 @@ public class iamagun : MonoBehaviour
|
|||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
if (!isInHand) return;
|
||||
if (OVRInput.IsControllerConnected(OVRInput.Controller.RTouch))
|
||||
{
|
||||
// Get the local position and rotation of the controller
|
||||
|
|
Loading…
Reference in New Issue