How can i set only a cframe position

i made a skill, which it twieens the position of a part, but when i tween the cframe of the part it tweens not only th eposition but even the orientation.
so i was wondering if there was a way to set only the cframe position and not even the orientation
(i tried looking on the forum but i couldnt find what i need)

A CFrame always defines an orientation. Do you want to tween CFrames with the default orientation or do you want to keep the orientation from when the tween started?

default orientation of the part

CFrame.new(vector3) creates a CFrame at a given position with default orientation.

Maybe you could try doing…

part.CFrame = CFrame.new(position, position + part.CFrame.LookVector)

I’m sorry, the previous formula only moved the part by the vector3 you gave it. This one actually sets the position and also sets the lookAt direction to what it was before moving.

1 Like
remote.OnServerEvent:Connect(function()
local God = game:GetService("ReplicatedStorage"):WaitForChild("Models").God:Clone()
	God.Parent = game.Workspace
	
	local Mesh = God["God Hand"]
	Mesh.Position = plr.Character:WaitForChild("HumanoidRootPart").Position + Vector3.new(0, 5, 0)
	Mesh.CFrame = plr.Character:WaitForChild("HumanoidRootPart").CFrame
	Mesh.Orientation = plr.Character:WaitForChild("HumanoidRootPart").Orientation + Vector3.new(0,0,30)
	
local TS = game:GetService("TweenService")

	local info = TweenInfo.new(1, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false)
	local info2 = TweenInfo.new(0.5, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false)

	local goal = {Size = Vector3.new(13.464, 17.745, 9.416), Position = plr.Character:WaitForChild("HumanoidRootPart").CFrame.Position + Vector3.new(0, 15, 0)}
	local goal2 = {CFrame = plr.Character:WaitForChild("Torso").CFrame * CFrame.new(0, 6, -9)}

	local a = TS:Create(Mesh, info, goal)
	local b = TS:Create(Mesh, info2, goal2)

	a:Play()
	wait(2.2)
	b:Play()
	end)

this is how i made the script so u can see

ok ill try that (30 C(ha)raCter((rsss))

You can always set the goals of the tween to end in the current orientation of the object, so it won’t rotate or anything.

local a = TS:Create(TweenInfo.new(1, Enum.EasingStyle.Quint, Enum.EasingDirection.Out, 0, false), {CFrame = plr.Character:WaitForChild("Torso").CFrame * CFrame.new(0, 6, -9z)}):Play()

u mean like this?

never mind this fixed, thank you

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.