So, I've been at this for a few hours, and I've hit a bit of a rut. As an example of what I'm using to calculate an angle from 0 - 360 degrees using a GUI, I wrote a string of code that moves a dot on the screen around a dot in the center of the screen. A snippet of the code looks like this ('origin' being the center dot and 'del' being the dot that moves according to mouse input):
inputservice.InputChanged:connect(function(input, ongui)
inputservice.MouseBehavior = Enum.MouseBehavior.LockCenter
if input.UserInputType == Enum.UserInputType.MouseMovement then
local d = input.Delta
local p = input.Position
origin.Position = UDim2.new(0, p.X - 3, 0, p.Y - 3)
del.Position = UDim2.new(0, p.X + (d.X * 2) - 3, 0, p.Y + (d.Y * 2) - 3, 0)
end
end)
The math I'm trying to do, with the knowledge that I have, doesn't work. The end product is supposed to be a GUI in the center that rotates based on where the mouse would move, while keeping the mouse and camera locked in place. Does anyone have any recommendations?
