Caching position to avoid multiple built-in calls
This commit is contained in:
parent
d4790ce4eb
commit
da88241204
|
@ -24,8 +24,10 @@ namespace GameDev.CoreSystems
|
||||||
|
|
||||||
if (!(_timeUntilFire <= 0)) return;
|
if (!(_timeUntilFire <= 0)) return;
|
||||||
|
|
||||||
var ray = new Ray(BarrelEndPoint.position, BarrelEndPoint.forward);
|
var position = BarrelEndPoint.position;
|
||||||
Debug.DrawRay(BarrelEndPoint.position, BarrelEndPoint.forward * 10, Color.green);
|
var forward = BarrelEndPoint.forward;
|
||||||
|
var ray = new Ray(position, forward);
|
||||||
|
Debug.DrawRay(position, forward * 10, Color.green);
|
||||||
|
|
||||||
if (Physics.Raycast(ray, out RaycastHit hitInfo))
|
if (Physics.Raycast(ray, out RaycastHit hitInfo))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue