I can't really tell from the info you're provided.
"In music, an ostinato is a motif or phrase that persistently repeats in the same musical voice, FREQUENTLY in the same pitch."
If the pitch changes as it moves through a piece then it's more commonly referred to as a riff.
To use an ostinato that doesn't change pitch you need to have your brain switched on and be aware of what you're doing as well as why you're doing it.
Why on earth not?
In pop..."Donna Summer and Giorgio Moroder's "I Feel Love" (1977), Henry Mancini's theme from Peter Gunn (1959), The Who's "Baba O'Riley" (1971), and The Verve's "Bitter Sweet Symphony" (1997)." are some decent examples.
Look, listen, listen while looking and learn. It's a fun thing.
https://en.wikipedia.org/wiki/Ostinato