So, I'm making a cannon and when the cannon is being shot it works perfectly fine but it rotates it 90 degrees when it's moving and it's annoying.
(I'm using TweenService by the way)
The bullet moves to the goal position I want it to, but it's rotating 90 degrees, the cannon's orientation is (0, 90, 0) but when I rotate the cannon to (0, 0, 0) it works perfectly fine with no rotations or anything but I need the cannon to face the direction I have it in which is (0, 90, 0) is there a way to keep the same rotation while moving the part?
local tweenService = game:GetService('TweenService')
local bullet = script.Parent.Bullet
local goals = {
CFrame = CFrame.new(-2481.297, 266.085, -11116.204);
}
local info = TweenInfo.new(
1,
Enum.EasingStyle.Linear,
Enum.EasingDirection.In
)
spawn(function()
while wait(2.25) do
local newBullet = bullet:Clone()
newBullet.Transparency = 0
newBullet.Touched:connect(function(hit)
if hit.Parent:FindFirstChild('Humanoid') and hit.Parent ~= nil then
hit.Parent:BreakJoints()
elseif hit.Parent:IsA('Accessory') then
hit.Parent.Parent:BreakJoints()
end
end)
newBullet.Parent = script.Parent
local down = tweenService:Create(newBullet, info, goals)
down:Play()
wait(.8)
for i = 0, 1, .1 do
newBullet.Transparency = newBullet.Transparency + 0.1
wait()
end
newBullet:Destroy()
end
end)

2 comments
I'm not sure how to utilize that with TweenService though.
The lookVector isn't in degrees. It's a normalized vector which points in the direction of the rotation.