How can I make the camera keep on following the player during the Rotation tween.
If I set the CFrame of the camera * the rotation then the camera won’t follow so I dont really know how else would I approach this. Please don’t give me any answers that don’t use CFrame or Lerp.
You’ll probably have to use lerp or some other method to transition from a starting orientation to the goal orientation while keeping the position of the camera the same the whole way through.
I’m thinking the camera position update in the default camera scripts is being overwritten with your script so the position doesn’t update before you change the angle. You’ll probably need to bind your rotational change to the step event and set the priority to just after the camera update priority.
That or manually update the position of the camera during your tween.
I understand what you mean, could you please give me an example of how I would go for such an approach since I am not familiar with that kind of thing.
Its going to be more complicated then just a one liner. If you RunService | Roblox Creator Documentation you can change the rotation of the camera at priority 201. But the very next step it will change it back, so you’ll need some sort of check to say: if animation is at time x then rotate y degrees so the rotation changes with each step and sync with the animation.
Basic Example:
RunService:BindToRenderStep("camRotater", 201, function()
local animPercent = myAnimTrack.TimePosition/myAnimTrack.Length
local rotAmount = animPercent * 25
camera.CFrame = camera.CFrame * CFrame.Angles(0,0,math.rad(rotAmount))
end)
To be honest, I barely ever use tweens, but I’m not sure how well a tween would work in the renderstep, my example is sort of doing a manual tween. What you’ve said may work, I personally just don’t know.