holding position

I’m working on a game where you jump from platform to platform, but each time the player jumps on one it flies away. I tried locking the position with the rigidbody, but for some reason when I press play, they all unselect except for z.
rigidbody.freezeRotation = true;
transform.rigidbody.constraints = RigidbodyConstraints.FreezePositionY;
transform.rigidbody.constraints = RigidbodyConstraints.FreezePositionX;
transform.rigidbody.constraints = RigidbodyConstraints.FreezePositionZ;
This doesn’t seem to work either.
Any advice?
P.S. There’s going to be hundreds of platforms so manually programming the specific position for each one would not be possible.

You want to do:

 transform.rigidbody.constraints = RigidbodyConstraints.FreezePositionX | RigidbodyConstraints.FreezePositionY | RigidbodyConstraints.FreezePositionZ;

Those are flags and you have to put them on together like that.