Little fix on player, added trigger collider on usp

@juliuse98 needs to fix when looking up the weapon gets to far away an the hands look strange. Tried to fix it a bit. Its no a little better but NOT completely fixed.

USP has now a collider that is a trigger. When the weapon is clipping through the wall (befor that the collider should trigger and the player puts the weapon upright) ITS NOT WORKING but the structure is there... (All collider gets disabled when you pick up a weapon)
This commit is contained in:
Noah4ever
2021-12-15 13:19:10 +01:00
parent bdf043d299
commit 572344254d
9 changed files with 174 additions and 109 deletions

View File

@@ -19,6 +19,7 @@ public class Weapon : MonoBehaviour
[SerializeField] int magazinSize = 0;
[SerializeField] int totalAmmunition = 0;
[SerializeField] GameObject bulletExit;
[SerializeField] bool toCloseToWall = false;
[SerializeField] bool allowAction = true;
[Header("")]
[SerializeField] Animator weaponAnimator;
@@ -37,6 +38,7 @@ public class Weapon : MonoBehaviour
public int MagazinSize { get => magazinSize; set => magazinSize = value; }
public int TotalAmmunition { get => totalAmmunition; set => totalAmmunition = value; }
public GameObject BulletExit { get => bulletExit; }
public bool ToCloseToWall { get => toCloseToWall; set => toCloseToWall = value; }
public bool AllowAction { get => allowAction; set => allowAction = value; }
public Animator WeaponAnimator { get => weaponAnimator; }
public Transform GunLeftREF { get => gunLeftREF; }
@@ -48,4 +50,13 @@ public class Weapon : MonoBehaviour
CurrentAmmunition = MagazinSize;
}
// When to close to a wall, the player puts the weapon upright (Change size on weapon collider where isTrigger == true)
/*private void OnCollisionEnter(Collision collision) {
toCloseToWall = true;
Debug.Log(collision.transform.name);
}
private void OnCollisionExit(Collision collision) {
toCloseToWall = false;
}*/
}