diff --git a/Assets/Scripts/HUD Scripts/Ship Builder Scripts/ShipBuilderCursorScript.cs b/Assets/Scripts/HUD Scripts/Ship Builder Scripts/ShipBuilderCursorScript.cs index 2e4d4370a..1a01e3a6d 100644 --- a/Assets/Scripts/HUD Scripts/Ship Builder Scripts/ShipBuilderCursorScript.cs +++ b/Assets/Scripts/HUD Scripts/Ship Builder Scripts/ShipBuilderCursorScript.cs @@ -67,8 +67,15 @@ public void GrabPart(ShipBuilderPart part) { parts.Add(part); part.rectTransform.SetAsLastSibling(); } - // offset = Vector2.zero; - offset = part.GetComponent().anchoredPosition - GetComponent().anchoredPosition; + + // code to ensure part does not snap to cursor immediately + var pos = part.GetComponent().anchoredPosition; + + // if the initial position is zero that means this is a new part, don't set an offset + if(pos == Vector2.zero) + offset = Vector2.zero; + else + offset = pos - GetComponent().anchoredPosition; currentPart = part; } void PlaceCurrentPart() {