1
0
forked from cgvr/DeltaVR

make NPC character prefab + fix arrow hit detection

This commit is contained in:
2025-12-22 10:59:07 +02:00
parent 2262609cdd
commit 236f0758df
5 changed files with 325 additions and 3 deletions

View File

@@ -86,7 +86,7 @@ public class ArrowCaster : NetworkBehaviour
yield return null;
}
Debug.Log(_hit.transform.name);
Debug.Log("Arrow hit transform: " + _hit.transform.name);
// Once the arrow has stopped flying
DisablePhysics();
@@ -114,6 +114,8 @@ public class ArrowCaster : NetworkBehaviour
private void CheckForHittable(RaycastHit hit)
{
if (hit.transform.TryGetComponent(out IArrowHittable hittable))
{
hittable.Hit(_arrow);
}
}
}