Frame being confused on position

I am trying to make 2d physics like IP, but the positioning is… questionable.
It would be better if i just shown you images.
Screenshot 2024-07-08 083929

My code:

while wait() do
	for i, obj in pairs(script.Parent:GetChildren()) do
		if obj:IsA("Frame") then
			obj:Destroy()
		end
	end
	for i, obj in pairs(workspace.Objects:GetChildren()) do
		if obj:IsA("BasePart") then
			local Frame = game.ReplicatedStorage.Frame:Clone()
			Frame.Parent = script.Parent
			Frame.Position = UDim2.new() - UDim2.new(0, obj.Position.X * 10, 0, obj.Position.Y * 10) + UDim2.new(0.5, 0, 0.5, 0)
			Frame.Size = UDim2.new(0, obj.Size.X * 10, 0, obj.Size.Y * 10)
			Frame.Rotation = 0 - obj.Orientation.X
			Frame.BackgroundColor = obj.BrickColor
		end
	end
end

seriously?

UDim2 and CFrame are not the same thing, you cant just use cframe coords and make the frame positions

also, why cant you just set the camera to a fixed angle so it looks like 2d?

1 Like

i want it to be 100% 2d.

It looks like you want an orthogonal view for your game. This is not possible inside of roblox as it does not have an orthogonal camera.

This post discusses a work around that may work for you:
How to have an have an orthographic view? - Help and Feedback / Game Design Support - Developer Forum | Roblox

i am not using others’ engines.

What do you mean?
I’m not suggesting that you use other people’s engines, that post is just an example of how you can use the camera FOV to make objects look as if they are 2D.