What do you want to achieve? Keep it simple and clear!
I would like to make a non primary part inside a model point at another part while maintaining the same primary part position and same offset to the primary part.
What is the issue? Include screenshots / videos if possible!
I cannot figure this out
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried searching the devforum
here is an example
so here is what it is like now:
here is what i want it to be:
as you can see the gray parts position did not change, it retained the same rotational and positional offset to the green part, and the green part is facing the red part.
You can just get the gray part’s CFrame relative to the green’s CFrame using :ToObjectSpace then call :ToWorldSpace after changing the orientation of the green part. So like:
local grayPart = workspace.Model.GrayPart
local greenPart = workspace.Model.GreenPart
local grayCFrameRelativeToGreenCFrame = greenPart.CFrame:ToObjectSpace(grayPart.CFrame) -- sorry for the long name lol
greenPart.CFrame = CFrame.lookAt(greenPart.Position, workspace.RedPart.Position)
grayPart.CFrame = greenPart.CFrame:ToWorldSpace(grayCFrameRelativeToGreenCFrame)
I’m a bit confused now, you want the green part to move independently of the gray part? You should be able to just assign the green part’s CFrame property using CFrame.lookAt without :PivotTo.
as you can see the gray parts position did not change, it retained the same rotational and positional offset to the green part, and the green part is facing the red part.
i would just create a sub group and make a model of the green and gray part with the green being the primary part. Then use the Model:PivotTo() function to rotate the green part. Thisll rotate the gray part about the green part keeping its relative transform
use the same method i mentioned earlier however instead make the gray part the primary part. Use this line of code. Model is the model containing the gray and green part with gray as the PP