Camera deletes itself on play?

i am creating a game and for inventory im using viewport frames so every item has a camera in it that the viewport frame uses to generate an image of the item, but when i press play the camera just disappears here is a picture
before play:
image
and in play:
image
any suggestions how could i fix that

The axe needs to be parented to the ViewportFrame. Here is a tutorial on how to use them.

its just a template so i cant connect it because for some tools the camera will be different
or do i have to set one camera for every item?

You can remove the axe from the ViewportFrame and put something else in it when you don’t need it there.

yeah thats what the script it doing wait let me send you a screenshot
edit: i mean the inventory script


sorry for the small letters but i wanted to fit everything in

Is the camera set to the correct position?

yeah it is i have checked already here is a screenshot of the item frame template in edit mode
image
this is how its supposed to look like, may change later but that doesnt matter since the image is not even working

I had this problem a really long time ago. If I recall correctly the way you’re going about this doesn’t work. The camera will always disappear in play mode and there is no way around it.

What you can do is write a script that creates a new camera and sets the camera position and the Viewport.CurrentCamera to the new camera. The camera has a CFrame property so maybe you could just get the CFrame of the camera you already have and use that in the new camera

7 Likes

yeah i guess that fixes the issue