4 lines
1.2 KiB
JSON
4 lines
1.2 KiB
JSON
{"file_path": "game.StarterPlayer.StarterPlayerScripts.OrnamentCraftUI.ShopKit", "datamodel_type": "Edit", "studio_id": "0411fa4a-b0e9-4eb3-8d9b-e8e08277ee91",
|
|
"edits": [{"old_string": "function K.frameCraft(model, cam, angle, aspect)\n\tmodel:PivotTo(CFrame.Angles(0, math.rad(angle or K.CRAFT_YAW), 0))\n\tlocal track = model:FindFirstChild(\"Track\")",
|
|
"new_string": "function K.frameCraft(model, cam, angle, aspect)\n\tlocal track = model:FindFirstChild(\"Track\")\n\tif not track then\n\t\t-- other crafted items (front = +Z): three-quarter front view, whole item in the frame\n\t\tmodel:PivotTo(CFrame.Angles(0, math.rad(-22), 0))\n\t\tlocal cf, sz = model:GetBoundingBox()\n\t\tcam.FieldOfView = 30\n\t\tlocal fitV = (sz.Y / 2 + 0.15 * sz.Y) / math.tan(math.rad(15))\n\t\tlocal fitW = (math.max(sz.X, sz.Z) / 2 * 1.15) / (math.tan(math.rad(15)) * math.min(aspect or 1, 1.4))\n\t\tlocal up = math.rad(14)\n\t\tlocal dir = Vector3.new(0, math.sin(up), math.cos(up))\n\t\tcam.CFrame = CFrame.lookAt(cf.Position + dir * (math.max(fitV, fitW) + math.max(sz.X, sz.Z) / 2), cf.Position)\n\t\treturn\n\tend\n\tmodel:PivotTo(CFrame.Angles(0, math.rad(angle or K.CRAFT_YAW), 0))"}]}
|