Fix gun bobbing in hand
This commit is contained in:
		
							parent
							
								
									c31d32182b
								
							
						
					
					
						commit
						745e2fa1e4
					
				| @ -130,6 +130,7 @@ MonoBehaviour: | ||||
|   Sprite: {fileID: 4462327695001662280} | ||||
|   BulletHole: {fileID: 427857587156450783} | ||||
|   Cooldown: 0.2 | ||||
|   Bobbing: {fileID: 3522608540502111974} | ||||
| --- !u!114 &3522608540502111974 | ||||
| MonoBehaviour: | ||||
|   m_ObjectHideFlags: 0 | ||||
|  | ||||
| @ -2,6 +2,7 @@ | ||||
| using System.Collections.Generic; | ||||
| using UnityEngine; | ||||
| using Saltosion.OneWeapon.Player; | ||||
| using Saltosion.OneWeapon.Effects; | ||||
| 
 | ||||
| namespace Saltosion.OneWeapon.Guns { | ||||
|     public class Gun : MonoBehaviour { | ||||
| @ -10,6 +11,7 @@ namespace Saltosion.OneWeapon.Guns { | ||||
|         public SpriteRenderer Sprite; | ||||
|         public Transform BulletHole; | ||||
|         public float Cooldown = 0.5f; | ||||
|         public Bobbing Bobbing; | ||||
| 
 | ||||
|         private bool IsHeld = false; | ||||
|         private float CurrCooldown = 0; | ||||
| @ -27,9 +29,10 @@ namespace Saltosion.OneWeapon.Guns { | ||||
|             PlayerController Player = collision.collider.GetComponent<PlayerController>(); | ||||
|             if (Player != null) { | ||||
|                 IsHeld = true; | ||||
|                 Player.SetGun(this); | ||||
|                 Bobbing.BobbingMultiplier = 0; | ||||
|                 Destroy(GetComponent<BoxCollider2D>()); | ||||
|                 Destroy(GetComponent<Rigidbody2D>()); | ||||
|                 Player.SetGun(this); | ||||
|             } | ||||
|         } | ||||
| 
 | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user