Script for only some prefabs

Hello,

Is there a way for only a few prefabs to run a specific script? For example I’m making a game where the player has to dodge falling blocks (which are prefabs) but only some blocks will fall. So is it possible to make a script for the falling blocks, and add it to them without the rest of the blocks falling? Thanks.

It’s hard to help with this few information.
Why don’t you add a condition / public bool to control which blocks are falling ?
Why can’t you use different prefabs for the falling and non-falling blocks ?

You can make a prefab variant - unity gives you an option to create one when you make a prefab out of a prefab - which you could then add the script to. This would mean you have two prefabs, one falling and one still, but the falling one would still track the changes made in still as it is based off it.