Skip to content

Commit 9458032

Browse files
committed
Changes how to measure distance from character to entities
1 parent f4cc3ed commit 9458032

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Scripts/AimAtCursorPlayerCharacterController.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ public override void FinishBuildAimControls(bool isCancel)
449449
public void FindAndSetBuildingAreaByAxes(Vector2 aimAxes)
450450
{
451451
int tempCount = 0;
452-
Vector3 tempVector3 = MovementTransform.position + (GameplayUtils.GetDirectionByAxes(CacheGameplayCameraTransform, aimAxes.x, aimAxes.y) * ConstructingBuildingEntity.buildDistance);
452+
Vector3 tempVector3 = CacheTransform.position + (GameplayUtils.GetDirectionByAxes(CacheGameplayCameraTransform, aimAxes.x, aimAxes.y) * ConstructingBuildingEntity.buildDistance);
453453
switch (CurrentGameInstance.DimensionType)
454454
{
455455
case DimensionType.Dimension3D:
@@ -494,8 +494,8 @@ private bool LoopSetBuildingArea(int count)
494494
{
495495
tempTransform = GetRaycastTransform(tempCounter);
496496
tempVector3 = GetRaycastPoint(tempCounter);
497-
tempOffset = tempVector3 - MovementTransform.position;
498-
tempVector3 = MovementTransform.position + Vector3.ClampMagnitude(tempOffset, ConstructingBuildingEntity.buildDistance);
497+
tempOffset = tempVector3 - CacheTransform.position;
498+
tempVector3 = CacheTransform.position + Vector3.ClampMagnitude(tempOffset, ConstructingBuildingEntity.buildDistance);
499499

500500
buildingArea = tempTransform.GetComponent<BuildingArea>();
501501
if (buildingArea == null ||

0 commit comments

Comments
 (0)