Uriah I hope you can shed some light on this because I'm all confused now.
What I mean is that when I was first taught how to play the bass I was told that I was to find the root note, let's take G for example. Well my teacher told me to go 2 frets to the right and 2 strings down and that's an octave which is another G. Well he also told me that you should use any of the notes between those two octaves, like for example, 4 frets to the right of G would put you on B so you he told me that you can use all the notes between G and B when you're in the key of G, He then tells me that on the next string(the A string) you can start with C which is the 4th of G and go 4 frets down and be on the E note and you can play all the notes in between the C and the E and still be in the key of G, on the D string, the only notes left are F# and G which are the 4th and 5th fret. He said that you can't go to the left of those or you would be out of key.
Before I went to him to learn how to play, I was teaching myself and I was playing using the same method you were playing those riffs you just posted, but once I went to him, he told me that you're always suppose to start with the root and then go from right to left. He said that if you started on the root and goes to the left then you would be out of key.
I hope you understand what I'm trying to say. If you can explain to me more clearly on how you can start on the root and then go to the left like you did in the above examples I'd gladly appreciate. Maybe I was doing it all wrong when I showed my teacher that's why he stopped me from doing it all together.