What do you want to achieve?
all I want is to tween the orientation of the camera without tweening the position via CFrame
What is the issue?
The code i have does tween the camera’s rotation, however since I’m forced to use CFrame as the tween value it also keeps the camera stationary when the tween starts when i only want to rotate it but keeping its position on the character
What solutions have you tried so far?
pretty much a skim on devforum, and the wiki to see if it was possible to change the rotation of the camera without using the same statement i see everywhere:
Trust me, I’m fully aware about radians and rotational values. The issue is that when the tween plays, while yes it rotates, but it also stays in place until the tween is done and then places the position back onto the character.
Oh, well, you might want to be using a repeat instead.
local origx, x= math.random(-180, 180), x
local origy, y = math.random(-180, 180), y
local timer = 5 --seconds
local hasbeen = 0
repeat
local took = task.wait()
local xrad = x > origx/(took/timer) and math.rad(origx/(took/timer)) or math.rad(x)
local yrad = y > origy/(took/timer) and math.rad(origy/(took/timer)) or math.rad(y)
cam.CFrame = cam.CFrame * CFrame.Angles(xrad, yrad, 0)
hasbeen += took
x -= x > origx/(took/timer) and origx/(took/timer) or x
y -= y > origy/(took/timer) and origy/(took/timer) or y
until hasbeen >= timer or x== 0 and y == 0
while i appreciate the snippet of code you’ve given me, I ended up just going with sleitnik’s EzCameraShake module, since doing the math myself would just be a whole other project and a headache that’s just not worth