HRP.CFrame vs Character:GetPivot() for players and/or NPCs

What would be better for getting the CFrame of the player/NPC? If I just do :GetPivot() The code will look much cleaner

But if I do HRP.CFrame I will need to find the HumanoidRootPart and then Access the CFrame value

But more people use the second one so I don’t know what to use

1 Like

I would always use :GetPivot(). Like you said there is no need to get the parts in the code to reference the CFrame value, and there is also no need for getting the PrimaryPart, checking if the model even has a PrimaryPart to find the part which stores the CFrame, and no need to wait for parts to load in. Especially with having StreamingEnabled on and having it set to nonatomic, models will load in without some of their parts; its important to be able to reference the CFrame without guarentee of parts even being there in the first place.

I think most people use the HumanoidRootPart or other PrimaryParts of models for CFrames nowadays mainly because that was the most reliable way previously. :GetPivot() is a newer method, so people know less about it or have seen less tutorials / code online with it.

4 Likes

Same thing with :ToPivot()

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.