Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Making Objects in Guis?

Hey,

Note: I am a very advanced scripter, so don't be afraid do use complex grammar and/or scripting terminology.

I was wondering how to make players have a 3D part/model in their guis? I've seen many games having it. I've tried making the part offset in front of the camera, then realized that it could still affect the player.

My Code:

repeat wait() until script.Parent.Parent.Character

local part = Instance.new("Part",game.Workspace)
part.Anchored = true
part.CanCollide = false
local char = script.Parent.Parent.Character
local cam = game.Workspace.CurrentCamera
local mouse = game.Players.LocalPlayer:GetMouse()

game.Players.LocalPlayer.CameraMode = "LockFirstPerson"
cam.Changed:connect(function()
	part.CFrame = cam.CoordinateFrame + (cam.CoordinateFrame.lookVector*2)
end)

If anyone out there know how to help, I'd be very appreciative.

Thanks ~ObscureEntity

5 comments

1

You can't put a part 'in' a gui. What you're thinking of is probably just a screen shot of the wanted model, then putting it in an ImageLabel.

0

No, There's games that have rotating items in their guis.

0

Yes, it somehow takes a screenshot of the item, then puts it into an imagelabel.

0

No, it positions the part relative to the camera where the gui is located, CloneTrooper1019 made a module for doing this easily

0

Could you send me the moduel for this? Thanks.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.