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