i did an animation to the spikes which should give them a shaking animation but now they are not falling for some reason? i've added a rigidbody and it doesn't fall down https://imgur.com/a/5Ouzh8m script: https://pastebin.com/ntAyLhka
When you control a variable with an animator, you cannot control it with code at the same time because the animator will immediately overwrite your change. In this case, you can't change your transform.position because you are controlling transform.position with the animator. To solve this, you can either turn off your animator before you tell your spikes to fall, or you can have your animator on a parent object, animate the child object, and apply the falling logic to the parent object.
The other way is create a StateMachineBehaviour script (for more information https://docs.unity3d.com/ScriptReference/StateMachineBehaviour.html) for the animation and here you can control the rigibody and transform of you spike I'm sorry for my english