I have a cannon object on the front of the cannon that the cannon ball which its referencing going to the position of the cannon shoot. I need to mix the Orientation and the Position to make the cannon ball go in a certain direction.
Code here.
local direction = script.Parent.CannonShoot.Orientation
local clickdetector = script.Parent:WaitForChild("ClickDetector")
clickdetector.MouseClick:Connect(function()
local copy = game.Workspace.Part:Clone()
copy.Parent = workspace
copy.Position = script.Parent.CannonShoot.Position
copy.Orientation = script.Parent.CannonShoot.Orientation
copy.Anchored = true
while true do
copy.Position = copy.Position + Vector3.new () --i need help here because i need to mix the orientation and the position
wait(0.01)
end
end)

1 comment
To simultaneously manage the Position and Orientation of part, you must adjust the CFrame (Coordinate Frame) userdata. copy.CFrame = CFrame.new(copy.Position + Vector3.new(newPosition)) * CFrame.Angles(radianOrientation)