Pet system thumbnail not working because the pet models doesn't have cframe

My pet system isn’t working because the pet models I put in doesn’t have a cframe and this specific lines of the script needs revision to make the thumbnail of the pets work. Can someone please give me any suggestions of revising my script? Thanks.

	local cam = Instance.new("Camera", hatched.PetImage)
	hatched.PetImage.CurrentCamera = cam
	
	local vpfPet = pet:Clone()
	vpfPet.Parent = hatched.PetImage
	
	cam.CFrame = CFrame.new(vpfPet.Position + vpfPet.CFrame.LookVector * 3 + Vector3.new(0, -1, -1), vpfPet.Position)
	

image
delete that part also send image of the outputs error message

1 Like


I get this output whenever I try to purchase a pet.

The error says the problem. Position is not a valid property of a Model, and the Reindeer is a model. You could try to use Model:GetPivot().Position instead, or if it has a specific part that coordinates it’s position you can reference that and use it’s position. Also, CFrame is not a valid property of a Model, but you can use Model:GetPivot() which is a CFrame by the way.

local cam = Instance.new("Camera", hatched.PetImage)
hatched.PetImage.CurrentCamera = cam

local vpfPet = pet:Clone()
vpfPet.Parent = hatched.PetImage
local petPivot = vpfPet:GetPivot()

cam.CFrame = CFrame.new(petPivot.Position + petPivot.LookVector * 3 + Vector3.new(0, -1, -1), petPivot.Position)

If you have problems with orientation, you should probably make your own correctly oriented part welded to the pet model and then just reference it’s CFrame as the petPivot.

1 Like

Thanks man! I’m still quite a novice at scripting this really helps me a lot.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.