Essentially, I want this part to remain at a constant orientation of (0,0,0) while it is moving, however; it is always tilted to the side right now.
I’m not quite sure how to fix this, because it’s something I haven’t ever really tampered with before - but here’s the current code (only using RunService for testing purposes):
local Mouse = game.Players.LocalPlayer:GetMouse()
Mouse.TargetFilter = game.Workspace.MainPart
local TweenService = game:GetService("TweenService")
game:GetService("RunService").RenderStepped:Connect(function()
local ray = Ray.new(Mouse.Hit.p, Vector3.new(0,-25,0))
local part, pos, normal = workspace:FindPartOnRayWithIgnoreList(ray, {game.Workspace.MainPart, workspace.CurrentCamera})
if not part then
local Tween = TweenService:Create(game.Workspace.MainPart, TweenInfo.new(.2, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out, 0, false, 0), {CFrame = Mouse.Hit, Orientation = Vector3.new(0,0,0)}):Play()
end
end)
Any help is appreciated, thanks!