Skip to content

Commit

Permalink
Abysswalker aura collisions changed;
Browse files Browse the repository at this point in the history
  • Loading branch information
mismirnov committed Apr 16, 2024
1 parent c3628b1 commit 7e3fb64
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Assets/Prefabs/Enemies/Boss/Abysswalker.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -206,9 +206,9 @@ GameObject:
- component: {fileID: 1250986778480525305}
- component: {fileID: 1250986778480525304}
- component: {fileID: 1250986778480525303}
m_Layer: 6
m_Layer: 0
m_Name: Aura
m_TagString: Aura
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
Expand Down
9 changes: 9 additions & 0 deletions Assets/Scenes/Game.unity
Original file line number Diff line number Diff line change
Expand Up @@ -482227,6 +482227,9 @@ MonoBehaviour:
buckshotLifeTime: 0.1
inaccurancyDistanceBtwBuckshot: 3
buckshot: {fileID: 2122807544601713854, guid: aef268d95ac474163bbe5f00b8973faa, type: 3}
mask:
serializedVersion: 2
m_Bits: 320
--- !u!114 &33147777500129073
MonoBehaviour:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -483187,6 +483190,9 @@ MonoBehaviour:
buckshotLifeTime: 0.1
inaccurancyDistanceBtwBuckshot: 3
buckshot: {fileID: 2122807544601713854, guid: aef268d95ac474163bbe5f00b8973faa, type: 3}
mask:
serializedVersion: 2
m_Bits: 320
--- !u!4 &246004534627034343
Transform:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -528845,6 +528851,9 @@ MonoBehaviour:
buckshotLifeTime: 0.1
inaccurancyDistanceBtwBuckshot: 3
buckshot: {fileID: 2122807544601713854, guid: aef268d95ac474163bbe5f00b8973faa, type: 3}
mask:
serializedVersion: 2
m_Bits: 320
--- !u!1 &1402345627110393443
GameObject:
m_ObjectHideFlags: 0
Expand Down
4 changes: 1 addition & 3 deletions Assets/Scripts/Weapons/Bullet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,7 @@ private void FixedUpdate()
if (hit.collider == null) return;

if (hit.collider.CompareTag("Bullet")) return;

if (hit.collider.CompareTag("Aura")) return;


if (hit.collider.CompareTag("Enemy") && !enemyBullet)
{
hit.collider.TryGetComponent<Enemy>(out var enemy);
Expand Down
4 changes: 3 additions & 1 deletion Assets/Scripts/Weapons/Shotgun.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ public class Shotgun : Weapon
[SerializeField] private float buckshotLifeTime;
[SerializeField] private float inaccurancyDistanceBtwBuckshot;
[SerializeField] private GameObject buckshot;
[SerializeField] protected LayerMask mask;

protected override void Awake()
{
Expand Down Expand Up @@ -55,7 +56,7 @@ protected override void Shoot()

for (var i = 0; i < bulletsPerShot; i++)
{
if (Physics.Raycast(shotPoint.position, GetShootingDirection(), out var hit, distance))
if (Physics.Raycast(shotPoint.position, GetShootingDirection(), out var hit, distance, mask))
{
if (hit.collider != null)
{
Expand All @@ -71,6 +72,7 @@ protected override void Shoot()

enemy.TakeDamage(damage, stunTime);
}

DrawBuckshot(hit.point);
}
else
Expand Down
1 change: 0 additions & 1 deletion ProjectSettings/TagManager.asset
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ TagManager:
- Bullet
- Inventory-panel
- FX
- Aura
layers:
- Default
- TransparentFX
Expand Down

0 comments on commit 7e3fb64

Please sign in to comment.