I was working on a system for my game, basically combat, and got to adding the variable to get the rootpart of the character like so:
local player = playerthingblah -- not important for this discussion, I think
local character = player.Character -- can also have wait if on client
local rootpart = character:WaitForChild("HumanoidRootPart")
As I was looking over the code, I began to wonder if it was actually the “recommended” way (if there even is one) of getting the rootpart of the character? (I actually never really bothered trying to find out if there was one since I didn’t think too much of it)
I looked around at how others got some characters and I found a few different examples:
local humanoid = character:WaitForChild("Humanoid")
local rootpart = humanoid.RootPart -- gets rootpart from humanoid instance
and
local character = player.Character
local rootpart = character.PrimaryPart -- gets rootpart from primarypart of model
I remember there being other examples as well but thats the only ones I can remember finding off the top of my head.