The position to my brick is -150, -3, 267
I write this
script.Parent.CFrame = CFrame.new(-150, 0, 267)
I only want it to move my brick by the Y axis but it moves it by both the Y and the X
Why is this? It's annoying. I've tried to figure it out. Looked on the wiki and I didn't understand it. I did find CFrame.y but I think I used it wrong. Anyone?
Please use comments as opposed to another answer to post an update to your question.
CFrame.Angles is a possible solution to your problem as the part would be rotated 90 radians.
script.Parent.CFrame = CFrame.new(-150, 0, 267) * CFrame.Angles(0, math.rad(90), 0)
You are using the script.Parent.CFrame = CFrame.new(-150, 0, 267)
statement correctly.
There could be multiple reasons for this behavior. 1. It could be a BodyMover object inside of the part. 2. Another script intentionally or unintentionally rotating the object. 3. It could be a Roblox based glitch or corrupted chunk of code.
You could try recreating the place with only the objects you want (make sure there are no hidden or unwanted Scripts of any kind). The easiest way to do this would be to open a new place and copy the objects you want.
The following block of code should help find any unwanted scripts if any exist (it will print the path to all scripts in the game):
local function printScripts(parent) for _, v in ipairs(parent:GetChildren()) do if v:IsA"Script" then print(v:GetFullName()) end printScripts(v) end end printScripts(game)
Keep in mind that this will not include CoreScripts and StarterScripts.
If for some reason no objects are effecting this part. Try setting up a test place with only the bare minimum to see if you can recreate this behavior. If it still happens, contact Roblox to report a bug report.