STAY STILL

No matter what I do or what code I add, whenever my player cube touches a cube in the air, that cube spin or flies away. I’ve tried locking rotation and position, but that didn’t work for one reason or another.
I tried freezing the rigid body position and rotation and it only froze z. When I put them together with | it became intangible so my player just flies right through it

Have you tried making it Kinematic?

Click on the object in Hierarchy that you wish to remain still. In Inspector find the rigidbody component and click the box that says Is Kinematic

If the object is meant to stand still, you shouldn’t need a rigid body at all. Just create a cube in the position you want. By default it only has a box collider. That’s all you need.