Frame Position is on Dummy's Head

Hello, I am having issues trying to figure out how to get a Frame to be at the position of a Dummy’s Head that only the client can see. Essentially, once the Player (Client) has triggered a ProxyPromt it makes the Clients Camera go to the Dummy and then it will have Frames on the Dummy’s BodyParts. I am just having issues figuring out how to make the Frame be at those positions on the Players Screen.

2 Likes

Are you setting your Camera’s position to the HumanoidRootPart?

Cuz it looks like it.

You could also show the code cuz I may not know what position you used for the camera.

local Promt = script.Parent.ProximityPrompt
local Camera = workspace.CurrentCamera

Promt.Triggered:Connect(function(player)
	Promt.Enabled = false
	game:GetService('ReplicatedStorage').RemoteEvent:FireClient(player, script.Parent)
	local Character = player.Character or player.CharacterAdded:Wait()
	local Humanoid = Character:WaitForChild('Humanoid')
	Humanoid.WalkSpeed = 0
	Character:FindFirstChild('RightFoot').CFrame = script.Parent.Parent.PositionPlayer.CFrame
end)
local RS = game:GetService('ReplicatedStorage')
local Camera = workspace.CurrentCamera
local TweenService = game:GetService('TweenService')

RS.RemoteEvent.OnClientEvent:Connect(function(viewPart)
	Camera.CameraType = Enum.CameraType.Scriptable
	local TI = TweenInfo.new(1.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0)
	local Goal = {CFrame = viewPart.CFrame}
	local Animation = TweenService:Create(Camera, TI, Goal)
	Animation:Play()
end)

I’m setting the Players Camera CFrame to a specific part which is above the Dummy.
image

You can change the position of the part by setting it’s position to one of the Dummy’s parts and offset it by a certain amounts of vector.

I’m currently just doing it this way for ease. How can I make the Frame Position to the Dummy’s Head?

Try these API’s

https://create.roblox.com/docs/reference/engine/classes/Camera#WorldToViewportPoint
https://create.roblox.com/docs/reference/engine/classes/Camera#WorldToScreenPoint

This should help with what you are trying todo.

This doesn’t really help my case much.

	local worldPoint = Vector3.new(0.334, 0.5, -11.293)
	local vector, onScreen = Camera:WorldToViewportPoint(worldPoint)

	local screenPoint = Vector2.new(vector.X, vector.Y)
	local depth = vector.Z

The screenPoint doesn’t provide the Position at which the Frame needs to be even as a Udim2.


image