#Resetting part orientation

1 messages · Page 1 of 1 (latest)

feral quiver
#

I have a part in workspace that is randomly oriented, and all I want to do is place a block at the end of the part and reset its orientation to 0,0,0

This seems to be a difficult task for me.

Server script in ServerScriptService:

local function branch_offs(parent_branch, model)
    local end_of_branch = Instance.new("Part")
    end_of_branch.CFrame = parent_branch.CFrame * CFrame.new(0,parent_branch.Size.Y/2,0)
    end_of_branch.CFrame *= CFrame.Angles(0,0,0)
    end_of_branch.Size = Vector3.new(1,1,1)
    end_of_branch.Anchored = true
    
    end_of_branch.Parent = model
end

branch_offs(workspace.Part,workspace)

Would appreciate some help. Let me know if you need more information.

#

The block is successfully going to the end of the part, but it refuses to reset its orientation no matter what I do.

tall stirrup
#

end_of_branch.CFrame = parent_branch.CFrame * CFrame.new(0,parent_branch.Size.Y/2,0) * CFrame.Angles(0,0,0) what is this doing

#

the *= is just adding another * on the end

#

if you want to set the cframe, you have to set the cframe, with = Thumbs

feral quiver
#

I did that, but what it ends up doing is moving the part to the position 0,0,0 as well.

#

But I get what you mean, its just telling the part to rotate by 0 degrees in all directions with the *.

tall stirrup
#

multiply is not strictly rotate

feral quiver
#

But if I'm only multplying by CFrame.Angles() it is only telling the part to rotate, correct?

tall stirrup
#

what are you trying to do exactly

feral quiver
#

Place a part at the end of another randomly rotated part, with the new part at the end having no rotation at all.

#

I use CFrames to guide the new part to the end of the old one, but that incorporates the rotation of the old part, which I wish to remove.

#

Never mind, figured it out.

tall stirrup
#

put an attachment positioned where you want and set cframe to that

#

or construct new cframe without rotation at the attachments position