Need help with rotating a part from a certain pivot point

  1. What do you want to achieve? Keep it simple and clear!
    I’m trying to make a tree generator.

  2. What is the issue? Include screenshots / videos if possible!
    I’m having issues with rotating the branches.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I have looked at other forum posts like this: Help with rotating on Pivot

local Thickness = 2
local Branches = 10
local Height = 8
local Log = script.Parent
local BranchPosition
local Clone

function Branch(BranchPosition)
	Thickness = Thickness - 0.2
	Height = Height - 1
	Clone = Log:Clone()
	Clone.Size =,Thickness, Thickness)
	Clone.CFrame =, BranchPosition.Y + Height/2, BranchPosition.Z)
	Clone.Orientation =,0,60)
	Clone.Parent = script.Parent.Parent

script.Parent.Size =,Thickness, Thickness)
Log.Position =, Height/2 + 1, Log.Position.Z)
BranchPosition =, Height, Log.Position.Z)

In Studio, open “Pivot Editor” while selecting the branch and move the pivot to the end of the branch that is touching the tree. This alters the orientation the branch will rotate on.

1 Like

The pivot position is already at the end of the branch