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()
|
||||
|
||||
Reference in New Issue
Block a user