How to move a Model in the direction the Primary Part is facing?

Basically I’ve got a tree that has this random branch system which automatically rotates the branch before adding it to the tree.

The problem is I move the branch into the centre of the tree then rotate it randomly, this means sometimes the branch leaves are going into the tree instead of away from the tree.

I need a way to move the branches a few studs forward so the branch leaves are always facing away from the tree but I have no clue how to incorporate look vector while moving models

Its been a few years since I’ve restarted scripting so I’m a little rusty :confused:

Thanks For Reading ~ [redacted]

Well, to answer the title of your post (the body of it was sort of confusing to read) you simply:

part.CFrame = CFrame.new(spawnPosition + model.PrimaryPart.CFrame.LookVector * distance)

Thats only moving the Part I need to move the whole model

Then use Model:SetPrimaryPartCFrame()

The easiest way to do it is something like

Model:SetPrimaryPartCFrame(Model.PrimaryPart.CFrame*CFrame.new(0,0,-10))

You can also rotate by doing something like

CFrame = CFrame*CFrame.Angles(0,math.rad(30),0) -- rotate 30 degrees in y axis
1 Like

Thanks I Tried it this way and it worked perfectly, Thanks