This has been frustrating me for the past 3 - 4 hours, and I'm quite fed up of debugging on my own. I'm trying to move a block out by a certain amount of studs for 16 times, while keeping it at a -89.98 degree angle. Here's the main portion of the script:
local parx1 = script.Parent.CFrame.X local pary1 = script.Parent.CFrame.Y local parz1 = script.Parent.CFrame.Z local parch = parx1 game.Workspace.bookcheck.Touched:connect(function(hit) for i = 1,16 do parch = parch + .05 script.Parent.CFrame = CFrame.new(parch, pary1, parz1) * CFrame.Angles(0, -89.98, 0) wait(.05) end end)
In this, "bookcheck" is an invisible block with collisions off that fills an entire room. This script is within another block, and triggers whenever the other block is touched, of course.
The block moves correctly when triggered, however, the rotation is always messed up. No matter what I change the "90" to gives me the same rotation whenever it moves. The regular rotation is "0, -89.98, 0", but whenever I modify the Y axis (which seems to act like the X axis in-game), it suddenly makes the rotation "-180, 63.38, -180"
I would just use straight Vector3 (which doesn't mess up the rotation), but it's collision detection when moving makes it unable to be used.
Any help on this extremely frustrating issue would be greatly appreciated, since I'm am completely out of ideas, even after scouring every method the wiki has to offer.