Changing prefabs/ projectiles in game

I am looking for a way to change weapons in the game. For example, my gun is shooting red projectiles and after I collide with another item or object, it should start to shoot green projectiles.

Is there a way for me to change projectiles in a game?

You can change then coding, changing the material.color in each collision you made.

You’ll need to script it.