I have local cf = CFrame.fromOrientation(x+math.rad(15),y,z), but how do I tween it if there are no properties of it?
TweenService | Documentation - Roblox Creator Hub
Tween | Documentation - Roblox Creator Hub
What do you mean ‘no properties’?
You need to tween from one CFrame position to another CFrame position.
With your line of code you are changing the orientation from one CFrame to another.
Get your original CFrame orientation (1), then add the new CFrame to that from your calculation (2), then tween from 1 to 2.
Here’s an example on how you could do this:
local TWS = game:GetService("TweenService")
local object: Instance = script.Parent
local orientation = CFrame.fromOrientation() -- insert your cframe orientation math here
local tween = TWS:Create(object, TweenInfo.new(1), {CFrame = object.CFrame * orientation})
tween:Play()
Well no, I don’t have an object. Just a CFrame.
Oh, so you want to tween a CFrameValue or a CFrame variable?
yeah
awegwaeawedaw
I don’t think you can tween a variable, you might have to use a CFrameValue.
local TWS = game:GetService("TweenService")
local cframeValue = Instance.new("CFrameValue")
local orientation = CFrame.fromOrientation() -- insert your cframe orientation math here
local tween = TWS:Create(cframeValue, TweenInfo.new(1), {Value = cframeValue.Value * orientation})
tween:Play()
You don’t have an object?
What exactly are you trying to tween?
From your script is looks like you are rotating something (a Part, the Camera, what?) by the CFrame value of 15 degrees on the X axis.
You can tween CFrames as stated in the first link I posted, but only the CFrame Property of an object.