How to make a model to be on a players screen?

Hi,
I want to make model to be on players screen like when in Bubble Gum Simulator you opening eggs.

Heres what i mean:

How can i make it to be on screen? i know that it should be in workspace and be handled in local script so only 1 player can see it, but i don’t know how to make this model be on the position of the local camera

Have you considered using viewport frames for this?

image

If you put a model inside a viewport frame and then set the background transparency to 1, it should give you the desired result. Just make sure to set the ‘CurrentCamera’ property so the model is viewed properly and looks good.

image

1 Like

i know that there viewport frames, but i want it to be not in it because it will have better quality

In which case, the following should work. It sets the CFrame of your object (in this case, workspace.Pet) to the CFrame of the camera with a forward offset of 4 studs. This needs to be done every time the camera moves so the CFrame is properly updated with the new position.

game.Workspace.CurrentCamera.Changed:Connect(function()
    game.Workspace.Pet.CFrame = game.Workspace.CurrentCamera.CFrame + game.Workspace.CurrentCamera.CFrame.LookVector*4
end)

As long as this is done in a local script (with the pet object being cloned and inserted locally), then it will only be visible to the player.

1 Like

Yes thats what i wanted! Thank you!

i tryed something like this but had some issues but your way work!

while true do
Model:SetPrimaryPartCFrame(workspace.CurrentCamera.CFrame*CFrame.new(0,0,0))
wait()
end

Worth noting not only that this question has been asked before and you should’ve searched before posting, but a developer for it has also commented on how they did this before.