A little background, I'm trying to make a 3-Dimentional radar; I'm using a local part, a sphere which I negated the center and sections of so it's kind of wireframe. When the player tilts forward, I want the sphere, no matter what orientation it's in, to tilt forward from the player; if that makes sense. This is what I currently have:
Also, I have FilteringEnabled, so this is a local part; no one else can see it.
local plr = game.Players.LocalPlayer
local ship = plr.Character:WaitForChild("Plane")
local engine = ship.Parts.Engine
local radar = script.Parent.Radar
if ship.Parts:FindFirstChild("RadarPoint") == nil or game.Workspace.FilteringEnabled == false then
script:remove()
end
radar.Parent = game.Workspace
radar.Anchored = true
local lastx, lasty, lastz = 0,0,0
local deltaxtotal, deltaytotal, deltaztotal = 0,0,0
function updateRadar()
local x,y,z = engine.CFrame:toEulerAnglesXYZ()
local deltax, deltay, deltaz = x-lastx, y-lasty, z-lastz
deltaxtotal, deltaytotal, deltaztotal = deltaxtotal+deltax, deltaytotal+deltay, deltaztotal+deltaz
local position = ship.Parts.RadarPoint.CFrame
radar.CFrame = position * CFrame.Angles(deltaxtotal, deltaytotal, deltaztotal)
lastx, lasty, lastz = x,y,z
end
game:GetService("RunService").RenderStepped:connect(updateRadar)
It doesn't do what I want; it actually acts as a gyro, identifiying the orientation compared to 0,0,0.
I can think of two ways to achieve my goal.
Figure out the trig required to alter all of the CFrame angles so that it does what I want(I can deal with this if I have to, I would just prefer to not if possible)
Reset the CFrame angles of the object to be 0,0,0 each time through but keep the orientation of the object. Is that possible? Edit: To be more clear, I want to be able to rotate the block based a specific coords and rotation, not based on the world coords and rotation. I.e. Rotate it so that, if I rotate on an axis, it always rotates the same direction relative to a different block.

1 comment
That is not correct, and, while it resets the CFrame each time, it doesn't do what I asked. I want to reset the CFrame, but keep the current orientation of the block. Essentially, say that, whatever the block's current rotation is is now 0,0,0