Item Display Menu like Trade Hangout

Hi there. I’m trying to make an object follow the camera as seen here:
https://gyazo.com/e455081476874e6641fbb0c53abb9414

My first thought that this was a viewportframe, but I realize it can clip into other objects, so it surely isn’t. I have read How to make a model to be on a players screen? this post, but still can’t manage to figure out the way it is done on that top gyazo. Here’s what I have so far;https://gyazo.com/513464ed0c60263a782733f7bcf5daca (I tried to move it to the left a bit, but as you can still see, it doesn’t act like it did in the first gyazo (Even if it was rotated around, which I can’t figure out how to do. Any help would be appreciated.

local dom = workspace.DominusAureus
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()

game.Workspace.CurrentCamera.Changed:Connect(function()
	dom.CFrame = game.Workspace.CurrentCamera.CFrame + game.Workspace.CurrentCamera.CFrame.LookVector*4 + Vector3.new(4,0,0)
end)
2 Likes

My guess why this dominus is always on the same position is that you are using vector3. As i noticed when tested if you use vector3 for cframes it would be like on ‘same’ position. But instead you can do something like this:

dom.CFrame = game.Workspace.CurrentCamera.CFrame * CFrame.new(0, 0, -10)

(You can experiment how will numbers change the position of dominus)

In this case dominus always will be in the center on a screen and -10 away from camera, so it won’t be inside camera but in front of it

You can setting this to make dominus be where you’d like it to be (like in example you gave)

2 Likes

Worked great to get the basic movement done, however I can’t manage to rotate it smoothly. I tried to set it’s rotation by code below, but so far doesn’t rotate. Any ideas?


game:GetService("RunService").RenderStepped:Connect(function()

	dom.CFrame = game.Workspace.CurrentCamera.CFrame * CFrame.new(-8, 3, -10) * CFrame.fromEulerAnglesYXZ(0,10,0)
end)
1 Like

Also had this problem!

I did the rotation of the part like this:

dom.CFrame = game.Workspace.CurrentCamera.CFrame * CFrame.new(0, 0, -10) * CFrame.Angles(0, math.rad(Rotation Degrees), 0)

Try experimenting with different numbers with and without math.rad.

You sure this works? I did this in the changed loop, but also tried RenderStepped, but the only rotation is when the game starts. Did you put it somewhere else?

( I tried it with & without rad & deg.)


game:GetService("RunService").RenderStepped:Connect(function()

	dom.CFrame = game.Workspace.CurrentCamera.CFrame * CFrame.new(-8, 3, -10) * CFrame.Angles(0, 0.5,0)

end)

Really don’t know what wrong here

I just tryed it and it work: https://gyazo.com/980793bdbea38ab0a60f26c4f0d99cbb

Download Place File and test it yourself: Dominus rotate place file.rbxl (21.9 KB)

1 Like