Code repair
This commit is contained in:
@@ -106,7 +106,7 @@ public class DraggableObject : MonoBehaviour
|
||||
rb.isKinematic = false;
|
||||
rb.linearVelocity = Vector3.zero;
|
||||
_dragPlane = new Plane(-mainCamera.transform.forward, hitPoint);
|
||||
targetPosition = hitPoint;
|
||||
targetPosition = new Vector3(this.transform.position.x, hitPoint.y, hitPoint.z);
|
||||
transform.localScale = originalScale * scaleOnDrag;
|
||||
if (Renderer != null)
|
||||
{
|
||||
@@ -119,7 +119,8 @@ public class DraggableObject : MonoBehaviour
|
||||
float distance;
|
||||
if (_dragPlane.Raycast(ray, out distance))
|
||||
{
|
||||
targetPosition = ray.GetPoint(distance);
|
||||
Vector3 hitPoint = ray.GetPoint(distance);
|
||||
targetPosition = new Vector3(this.transform.position.x, hitPoint.y, hitPoint.z);
|
||||
}
|
||||
}
|
||||
void EndDrag()
|
||||
|
||||
@@ -108,9 +108,9 @@ public class ObjectSpawner : MonoBehaviour
|
||||
Vector3 RandomPos(float margin)
|
||||
{
|
||||
return new Vector3(
|
||||
-2.24f,//Random.Range(minX + margin, maxX - margin),
|
||||
0f,//Random.Range(minY + margin, maxY - margin),
|
||||
0.5f
|
||||
Random.Range(-3, -4),
|
||||
-0.3f,
|
||||
Random.Range(-2f, 1.5f)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user