Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why can't I set the CustomPhysicalProperties of a character's parts?

Asked by 4 years ago
Edited 4 years ago

Sorry, my last question was incorrect for what I was looking for. For some reason, I can't set or print the CustomPhysicalProperties of a character's parts. [https://developer.roblox.com/en-us/api-reference/property/BasePart/CustomPhysicalProperties]

local function onPlayerJoin(player)
    player.CharacterAdded:Connect(function(character)
        local HumanoidRootPart = character:WaitForChild("HumanoidRootPart")
        print(HumanoidRootPart.CustomPhysicalProperties.Density)
    end)
end
game.Players.PlayerAdded:Connect(onPlayerJoin)

which just came out as this

attempt to index field 'CustomPhysicalProperties' (a nil value)

can anybody tell me what I'm missing?

Answer this question