Back to Scripts
3D Character Showcase Open Source for projects
ScriptBlox
Universal
Free
Game: Universal Script π
100
Views
1
Likes
0
Dislikes
ambrionhub23
offline
Features
Learn More: https://getambrion.space/
Open Source:
Show case 3d character features:
Zoom In Character
Move up/down
Minimize
Exit
Drag from top left button
Tags
Script Code
local Players = game:GetService("Players")
local TweenService = game:GetService("TweenService")
local UserInputService = game:GetService("UserInputService")
local Player = Players.LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local gui = Instance.new("ScreenGui")
gui.Name = "CharacterPreview"
gui.Parent = PlayerGui
local frame = Instance.new("Frame")
frame.Size = UDim2.new(0,300,0,300)
frame.Position = UDim2.new(0.5,-150,0.5,-150)
frame.BackgroundColor3 = Color3.fromRGB(30,30,30)
frame.BorderSizePixel = 0
frame.Parent = gui
Instance.new("UICorner", frame).CornerRadius = UDim.new(0,16)
local usernameLabel = Instance.new("TextLabel")
usernameLabel.Size = UDim2.new(1,0,0,30)
usernameLabel.Position = UDim2.new(0,0,0,5)
usernameLabel.BackgroundTransparency = 1
usernameLabel.Text = Player.Name
usernameLabel.TextColor3 = Color3.fromRGB(200,200,200)
usernameLabel.Font = Enum.Font.GothamSemibold
usernameLabel.TextSize = 18
usernameLabel.TextWrapped = true
usernameLabel.Parent = frame
local function createTopButton(symbol, offsetX)
local button = Instance.new("TextButton")
button.Size = UDim2.new(0,25,0,25)
button.Position = UDim2.new(1,offsetX,0,5)
button.BackgroundColor3 = Color3.fromRGB(50,50,50)
button.Text = symbol
button.TextColor3 = Color3.fromRGB(200,200,200)
button.Font = Enum.Font.GothamBold
button.TextSize = 18
button.Parent = frame
Instance.new("UICorner", button).CornerRadius = UDim.new(0,6)
return button
end
local minimizeButton = createTopButton("-",-60)
local closeButton = createTopButton("X",-30)
local minimized = false
minimizeButton.MouseButton1Click:Connect(function()
if minimized then
TweenService:Create(frame, TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),
{Size = UDim2.new(0,300,0,300)}):Play()
minimized = false
else
TweenService:Create(frame, TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),
{Size = UDim2.new(0,300,0,40)}):Play()
minimized = true
end
end)
closeButton.MouseButton1Click:Connect(function()
local tween = TweenService:Create(frame, TweenInfo.new(0.3,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),
{BackgroundTransparency = 1})
tween:Play()
tween.Completed:Connect(function()
gui:Destroy()
end)
end)
local viewport = Instance.new("ViewportFrame")
viewport.Size = UDim2.new(1,0,1,0)
viewport.Position = UDim2.new(0,0,0,0)
viewport.BackgroundTransparency = 1
viewport.Parent = frame
local character = Player.Character or Player.CharacterAdded:Wait()
local modelClone = Instance.new("Model")
modelClone.Name = "ViewportCharacter"
modelClone.Parent = viewport
for _, part in ipairs(character:GetDescendants()) do
if part:IsA("BasePart") or part:IsA("MeshPart") or part:IsA("Accessory") then
local clone = part:Clone()
clone.Parent = modelClone
end
end
local rootPart = modelClone:FindFirstChild("HumanoidRootPart") or modelClone:FindFirstChildWhichIsA("BasePart")
modelClone.PrimaryPart = rootPart
if modelClone.PrimaryPart then
modelClone:SetPrimaryPartCFrame(CFrame.new(0,0,0))
end
local cam = Instance.new("Camera")
viewport.CurrentCamera = cam
cam.Parent = viewport
local verticalOffset = 0
local zoomFactor = 1
local function updateCamera()
local size = modelClone:GetExtentsSize()
local rootPos = modelClone.PrimaryPart.Position
local baseDistance = math.max(size.X, size.Y, size.Z) * 1.5
local distance = baseDistance * zoomFactor
local heightOffset = size.Y/2 + verticalOffset
cam.CFrame = CFrame.new(rootPos + Vector3.new(0,heightOffset,distance), rootPos + Vector3.new(0,heightOffset,0))
end
updateCamera()
task.spawn(function()
while true do
if modelClone.PrimaryPart then
modelClone:SetPrimaryPartCFrame(modelClone.PrimaryPart.CFrame * CFrame.Angles(0, math.rad(1), 0))
end
task.wait(0.03)
end
end)
local function createButton(name, positionY, text)
local button = Instance.new("TextButton")
button.Name = name
button.Size = UDim2.new(0,30,0,30)
button.Position = UDim2.new(1,-35,positionY,0)
button.BackgroundColor3 = Color3.fromRGB(50,50,50)
button.Text = text
button.TextColor3 = Color3.fromRGB(200,200,200)
button.Font = Enum.Font.SourceSansBold
button.TextSize = 20
button.Parent = frame
Instance.new("UICorner", button).CornerRadius = UDim.new(0,6)
return button
end
local upButton = createButton("UpButton", 0.4, "β²")
local downButton = createButton("DownButton", 0.55, "βΌ")
downButton.MouseButton1Click:Connect(function()
verticalOffset = verticalOffset + 0.5
updateCamera()
end)
upButton.MouseButton1Click:Connect(function()
verticalOffset = verticalOffset - 0.5
updateCamera()
end)
local sliderFrame = Instance.new("Frame")
sliderFrame.Size = UDim2.new(0,15,0,150)
sliderFrame.Position = UDim2.new(0,5,0.5,-75)
sliderFrame.BackgroundColor3 = Color3.fromRGB(40,40,40)
sliderFrame.BorderSizePixel = 0
sliderFrame.Parent = frame
Instance.new("UICorner", sliderFrame).CornerRadius = UDim.new(0,8)
local handle = Instance.new("Frame")
handle.Size = UDim2.new(0,15,0,15)
handle.Position = UDim2.new(0,0,1,-15)
handle.BackgroundColor3 = Color3.fromRGB(200,200,200)
handle.BorderSizePixel = 0
handle.Parent = sliderFrame
Instance.new("UICorner", handle).CornerRadius = UDim.new(1,0)
local dragging = false
handle.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = true
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
dragging = false
end
end)
UserInputService.InputChanged:Connect(function(input)
if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
local relativeY = math.clamp((input.Position.Y - sliderFrame.AbsolutePosition.Y) / sliderFrame.AbsoluteSize.Y, 0, 1)
local goal = {Position = UDim2.new(0,0,relativeY,-7)}
TweenService:Create(handle, TweenInfo.new(0.15, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), goal):Play()
zoomFactor = 0.5 + (1.5 * relativeY)
updateCamera()
end
end)
local dragButton = Instance.new("ImageButton")
dragButton.Name = "DragButton"
dragButton.Size = UDim2.new(0,25,0,25)
dragButton.Position = UDim2.new(0,5,0,5)
dragButton.BackgroundColor3 = Color3.fromRGB(30,30,30)
dragButton.Image = "rbxassetid://15518030617" -- example grip icon, replace with your own
dragButton.Parent = frame
Instance.new("UICorner", dragButton).CornerRadius = UDim.new(0,6)
local draggingFrame = false
local dragStart, startPos
dragButton.InputBegan:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
draggingFrame = true
dragStart = input.Position
startPos = frame.Position
end
end)
UserInputService.InputChanged:Connect(function(input)
if draggingFrame and input.UserInputType == Enum.UserInputType.MouseMovement then
local delta = input.Position - dragStart
local newPos = UDim2.new(
startPos.X.Scale, startPos.X.Offset + delta.X,
startPos.Y.Scale, startPos.Y.Offset + delta.Y
)
-- Smooth tween toward new position
TweenService:Create(frame, TweenInfo.new(0.12, Enum.EasingStyle.Quad, Enum.EasingDirection.Out),
{Position = newPos}):Play()
end
end)
UserInputService.InputEnded:Connect(function(input)
if input.UserInputType == Enum.UserInputType.MouseButton1 then
draggingFrame = false
end
end)
--seperate watermark:
local Players = game:GetService("Players")
local player = Players.LocalPlayer
local screenGui = Instance.new("ScreenGui")
screenGui.Parent = player:WaitForChild("PlayerGui")
local container = Instance.new("Frame")
container.Size = UDim2.new(0, 350, 0, 25)
container.Position = UDim2.new(0.5, -175, 1, -40)
container.BackgroundTransparency = 1
container.Parent = screenGui
local textLabel = Instance.new("TextLabel")
textLabel.Size = UDim2.new(1, 0, 1, 0)
textLabel.Position = UDim2.new(0, 0, 0, 0)
textLabel.BackgroundTransparency = 1
textLabel.Text = "Learn more at: https://getambrion.space"
textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
textLabel.TextScaled = true
textLabel.Font = Enum.Font.SourceSans
textLabel.TextXAlignment = Enum.TextXAlignment.Center
textLabel.Parent = container
local underline = Instance.new("Frame")
underline.Size = UDim2.new(1, 0, 0, 2)
underline.Position = UDim2.new(0, 0, 1, -2)
underline.BackgroundColor3 = Color3.fromRGB(255, 0, 0)
underline.BorderSizePixel = 0
underline.Parent = textLabel
local domainButton = Instance.new("TextButton")
domainButton.Size = UDim2.new(0, 150, 1, 0)
domainButton.Position = UDim2.new(0.45, 0, 0, 0)
domainButton.BackgroundTransparency = 1
domainButton.Text = ""
domainButton.Parent = container
domainButton.MouseEnter:Connect(function()
textLabel.TextColor3 = Color3.fromRGB(0, 0, 255)
end)
domainButton.MouseLeave:Connect(function()
textLabel.TextColor3 = Color3.fromRGB(255, 255, 255)
end)
domainButton.MouseButton1Click:Connect(function()
setclipboard("https://getambrion.space")
textLabel.Text = "Copied link!"
wait(2)
textLabel.Text = "Learn more at: https://getambrion.space"
end)
-- made by ambrionπ
Comments (0)
Please login to comment
Login with Discord
Loading comments...