How to set player walkspeed velocity to max walkspeed in an instant

I just want to set the density to 100 and then when a certain condition changed it goes back to normal

Setting it to false will give you this error. “Unable to assign property CustomPhysicalProperties. PhysicalProperties expected, got boolean”. Setting it to nil achieves the same thing without raising an error.

Can you show the code that you have? Are there any errors in the output? This code works for me

No errors.
When condition met

local cpp = char:FindFirstChild("HumanoidRootPart").CustomPhysicalProperties
			cpp=PhysicalProperties.new(100,0.3,0.5)

Else not

local cpp = char:FindFirstChild("HumanoidRootPart").CustomPhysicalProperties
			cpp=nil

But this does not do anything.

Don’t define the property as a variable. This will copy the value and store it, it will not set a reference. Just set the property directly by indexing the HumanoidRootPart.

char:FindFirstChild("HumanoidRootPart").CustomPhysicalProperties = PhysicalProperties.new(100,0.3,0.5)
2 Likes

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