Grabbing a specific class inheritance from a prefab

So I have different behaviors attached to different weapons in a game. I’d like to grab those behaviors from the prefab when I use those items and attach the behaviors on my player instead. Is there a way I can grab that specific component inheritance from the prefab and attach it to my player?

It depends on how these behaviors are set up. I’m just going to assume that they are scriptable objects.

You should have a script on the prefab with a list of all the behaviors. Then you should have a script on the player with a list of behaviors as well (though it should be empty) and a reference to the item script. When you want to attach the behavior on the player, you can just use the Remove() method on the item script and Add() the removed behavior in the player script.

If you aren’t using scriptable objects, please upload a screenshot of how you set up your system.