Is there a way to zindex parts?

See how the tree goes through the egg? is there a way to make that not happen

1 Like

Hey, pretty sure there is some kind of a way related to this.

However, BasePart.AlwaysOnTop - #17 by 0xBAADF00D

This has been a request for years and years now, and we are seeking for it.

Honestly, you could stop the player humanoid with making their walkspeed 0, and then as well changing cameratype to scriptable so they can’t move it, after the egg has hatched, you can return it back.

Ok, thanks but im confused because i see that games like Bubble Gum Simulator have this working. Is it because they use a viewport frame or?

Did you try to use viewport frame? Because you for some reason moved eggs to workspace.

Did not notice that but if thats the case, that could work. @U_npluggedDev

Lol sorry I feel bad for asking for code help, but I have been stuck for like 3 hours on figuring out how to make the cframe stuff from the model turn into a viewport frame cframe
here is the code for the model

    local speed = 1.25 -- starting speed
	hatchOneConnection = RunService.RenderStepped:Connect(function()
		local cf = CFrame.new(0,0,-eggMesh.PrimaryPart.Size.Z * 2) * CFrame.Angles(0,0,math.sin(speed *time())/2)
		eggMesh:SetPrimaryPartCFrame(camera.CFrame * cf)
		if speed < 50 then
			speed += 0.01 * speed
		end
	end)
	eggMesh.Parent = camera
	wait(3)

Here is an example code of the viewport frame thing im using, what this does is turn a pet 360 degrees in 3 seconds.

    local i = 0
	
	while i < 180 do
		petModel:SetCFrame(CFrame.Angles(0,i/18, 0) * CFrame.Angles(math.rad(-10),0,0))
		i += 1
		
		task.wait()
	end

Here is what I have so far lol

    local eggModel = Module3D:Attach3D(script.Parent.Parent.PetDisplay,eggMesh)
	eggModel:SetDepthMultiplier(1.2)
	eggModel.Camera.FieldOfView = 5
	eggModel.Visible = true
	
	local speed = 1.25
	hatchOneConnection = RunService.RenderStepped:Connect(function()
		eggModel:SetCFrame()
	end)
I dont know what to put in the set Cframe though to make it progressively shake faster

Why don’t you use tween service or animations?

idk how i would implement tween service, and idk how to use animations