How to make a model show up on screen like a gui

Hey there,
I’m trying to make a crate opening system and was wondering how I could achieve the crate appearing on the players screen and then shaking back and fourth like a egg hatching game. Sorry for the poor explanation I wasnt sure where to even begin but as usual any input in greatly apricated :slight_smile:

Example:
example

if you want a 3d model on the gui then use viewport frames and move /rotate the model

1 Like

You will need to use viewportFrames, to see an item through it just do

local viewport = viewportFrame --change this to your viewport Frame
local crate = crate:Clone() --change this to your crate
crate.Parent = viewport
local camera = Instance.new("Camera" , viewport)

camera.CFrame = crate.PrimaryPart.CFrame + CFrame.new(0 , 0 , 5)
camera.CFrame = CFrame.LookAt(crate.PrimaryPart.Position , crate.PrimaryPart.Position)
--first cframe is to make it close to the crate and the second is to make it look at the crate
viewport.CurrentCamera = camera

All you need to do now is add that shaking, this is just the setup for the viewportFrame

3 Likes