I want to convert CFrame into the global axis somehow

Hello once again,
(I am attempting to move a model)
I am having trouble again, I don’t know much about CFrames and I need to convert HumanoidRootPart.CFrame into the global axis which I think would require Vector3, but when moving entire models, you have to use CFrame, and this creates a lot of problems. I looked on dev forum for solutions but couldn’t find anything, which is why I am making this post, is there a way to tween models using Vector3?

TweenService:Create(Boss.PrimaryPart,TweenInfo.new(1),{CFrame = FindNearestPlayer(Boss.PrimaryPart).Character.HumanoidRootPart.CFrame * CFrame.new(0,Boss.PrimaryPart.Size.Y + 2,0)}):Play()

For reference ‘Boss’ is a model, FindNearestPlayer() is a function that I created (copied and pasted) which works perfectly fine and does find the nearest player and everything else works right.
Please help.

Try this.


Local NearPlayer = FindNearestPlayer(Boss.PrimaryPart)
TweenService:Create(Boss.PrimaryPart,TweenInfo.new(1),{CFrame = CFrame.new(NearPlayer.Character.HumanoidRootPart.CFrame.X,NearPlayer.Character.HumanoidRootPart.CFrame.Y,NearPlayer.Character.HumanoidRootPart.CFrame.Z)}):Play()

Problem is that I want the ‘Boss’ model to go roughly 20 studs above the player, and if I add CFrame values to the Y part, then it will make the ‘Boss’ go 20 studs above the player locally, so if the player is tilted slightly, the boss will tilt slightly, which will break everything.

You can add a Vector3 to a CFrame to offset the CFrame in global coordinates:

boss.CFrame = rootPart.CFrame + Vector3.new(0,20,0)
1 Like

it works perfectly well, however, what if I want to make the ‘Boss’ model go back down again? if I do
TweenService:Create(Boss.PrimaryPart,TweenInfo.new(0.5),{CFrame = Boss.PrimaryPart.CFrame - Vector3.new(0,20,0)}):Play()
then the model goes into the ground instead of going back to the original position, and I just realised how unclear I made myself when making this post, sorry.

Then just change positional data only through a Vector3 value.