throwing a dart

How can i make a script that spawns a gameobject and when it touches an object with a certain tag the spawned object stays there, like throwing a dart, when it touches a wall it gets nailed there