So I’m trying to make a scope, I’m using a viewport to make the scope effect but I’m having problems with WorldToScreenPoint. Basically the viewport needs to follow this part:
The Code:
game:GetService("RunService").Heartbeat:Connect(function()
local vector, within = WorldToScreenPoint(workspace.CurrentCamera, ScreenPart.Position)
if within then
script.Parent.Parent.Position = UDim2.new(0, vector.X, 0, vector.Y)
end
destroyIntr(script.Parent.Interactables)
renderObj(game.Workspace.Map.Interactables, true)
end)
Instead I get this: https://gyazo.com/bf3c5d5428d07628945e9fcd95de4017
I searched on the forum, really found nothing.
Any help would be greatly appreciated!