Cloning A Part To A GUI

I’m really stuck right now and I need to know how can a part, possibly a part with emitters, be cloned to a GUI’s frame??

2 Likes

To put a part in a GUI, you could use viewportframes: ViewportFrame GUI
(I’m not sure if you can see the particles there) :woman_shrugging:

And if you need to put particles in GUI this could be very helpful rParticle: The Light Weight, Open Source, GUI Particle System

3 Likes

I will try the Viewport and see if the particles would appear from the part. I also checked out that forum already, it doesn’t quite have what I want but thx!

1 Like

Viewpoints didn’t work or I feel like I am doing something wrong because the part is not cloning to the frame.

Hi, you have to add a Camera into viewportframe and make sure the viewportframe current camera is equal to camera and make sure the current position of it is UDim2.new(0,0,0,0)

One last thing, I recommend to use this module it makes the item rotate and gives it a Very cool effect + you won’t have to do the things above Check it out here.

2 Likes

Particle emitters are unfortunately not rendered inside of ‘ViewportFrame’ instances.

1 Like

So do I have to create an instance inside of the Frame?

Just create the camera and make it look at that part and position it correctly and set viewport.CurrentCamera to that camera

I’m going to try this now and see what happens!

1 Like

Btw some tips

  1. Set the camera.CFrame to the part CFrame and then move it a bit
  2. Use CFrame.lookAt() to make it look at the part
2 Likes

I am cloning the part to the Viewport, so shouldn’t I set the part’s CFrame relative to the camera’s CFrame??

You’ll need to come up with your own custom particles system.

You have to do the CFrame of it.
Also Check it out here . this particle module it will help you

1 Like

No no, set the parts POSITION to 0 , 0 , 0 and same with the camera but add a small diff 0 , 4 , 0 or something like that, should be CFrame for the camera tho!
Idk if the particles will appear tho, if not, at least you learned something new!

I’ll test it out and see what I could do.

1 Like

The part is not being cloned, I don’t know if the camera’s even being made. Here’s the local script:

local player = game.Players.LocalPlayer
local MainGUI = player.PlayerGui:WaitForChild("MainParticlesGUI")
local MainFrame = MainGUI.MainFrame
local ReplicatedStroage = game:GetService("ReplicatedStorage")
local ConfettiCode = script.Parent
local ViewportFrame = ConfettiCode.ViewportFrame1
local ViewportCamera = Instance.new("Camera")

local StarFetti = ReplicatedStroage:WaitForChild("StarFetti")



if ViewportFrame:IsA("ViewportFrame") then
	if ViewportFrame ~= nil then
		local FettiClone = StarFetti:Clone()
		task.wait(3)
		if FettiClone ~= nil then
			FettiClone.Parent = ViewportFrame
			ViewportFrame.CurrentCamera = ViewportCamera
			ViewportCamera.Parent = ViewportFrame
			ViewportCamera.CFrame = CFrame.lookAt(FettiClone.Position + Vector3.new(0, 4, 0), FettiClone.Position)
			print("Cloned")
		end
	end	
end	

You made the look at, the positions are still wrong tho…

1 Like

Try this instead

viewportCamera.CFrame = CFrame.new(Vector3.new(0, 2, 12), FettiClone.Position)
2 Likes

No luck, guess I got to make my custom particles.

So weird how you can’t clone a part to a GUI but can’t do nothing about it.