I want to create a function where the player camera will be moved to position “pos” and the camera will look at position “aim”, but the camera won’t move to “pos”, it only look at “aim” without moving to position “pos”. If I use Camera.Focus, It only moves the camera without looking at “aim”.
Here’s my code:
function moveCam(mcam,Px,Py,Pz,Fx,Fy,Fz)
local pos = Vector3.new(Px,Py,Pz);
local aim = Vector3.new(Fx,Fy,Fz);
local temp = TS:Create(camera,TweenInfo.new(mcam,Enum.EasingStyle.Quad,Enum.EasingDirection.Out),{
CFrame = CFrame.new(pos,aim);
});
temp:Play();
end
I can’t find any topics about this.
What’s wrong with the code and how do I fix it?