You can open up a new baseplate and test this small code snippet:
local part = workspace.Part
part.TopSurface = Enum.SurfaceType.Motor
part.FrontSurface = Enum.SurfaceType.Hinge
part.BrickColor = BrickColor.new("Really blue")
local startCF = CFrame.new(Vector3.new(32.5, 1.5, -0.5))
local rs = game:GetService("RunService")
for i = 1,100 do
local lookAtCF = CFrame.new(startCF.Position,((startCF * CFrame.new(Vector3.new(0,0,-1))).Position) + Vector3.new(0,-i/100,0))
part.CFrame = lookAtCF
rs.RenderStepped:Wait()
end
It works like it’s supposed to, then test the Z Rotation:
local part = workspace.Part
part.TopSurface = Enum.SurfaceType.Motor
part.FrontSurface = Enum.SurfaceType.Hinge
part.BrickColor = BrickColor.new("Really blue")
local startCF = CFrame.new(Vector3.new(32.5, 1.5, -0.5))
local rs = game:GetService("RunService")
for i = 1,100 do
part.CFrame *= CFrame.Angles(0,0,math.rad(-3))
rs.RenderStepped:Wait()
end
also works like its supposed to, but then something weird happens when you combine them:
local part = workspace.Part
part.TopSurface = Enum.SurfaceType.Motor
part.FrontSurface = Enum.SurfaceType.Hinge
part.BrickColor = BrickColor.new("Really blue")
local startCF = CFrame.new(Vector3.new(32.5, 1.5, -0.5))
local rs = game:GetService("RunService")
for i = 1,100 do
local lookAtCF = CFrame.new(startCF.Position,((startCF * CFrame.new(Vector3.new(0,0,-1))).Position) + Vector3.new(0,-i/100,0))
part.CFrame = lookAtCF * CFrame.Angles(0,0,math.rad(-3))
rs.RenderStepped:Wait()
end
I want to get it to tilt forward while rotating on its Z axis.
I don’t understand why this is functioning like this, could someone explain?