This sounds a lot like lucid dreaming!
Lucid dreams are when you know that you’re dreaming while you’re asleep.
You’re aware that the events flashing through your brain aren’t really happening. But the dream feels vivid and real. You may even be able to control how the action unfolds, as if you’re directing a movie in your sleep.
Studies suggest that about half of people may have had at least one lucid dream. But they probably don’t happen often, usually only a handful of times in a year.
From WebMD (Lucid Dreams: Definition, Benefits, Dangers, How to Do It)
We’ve had a few different topics on lucid dreaming here on the forum. Lucid dreaming is a bit different than astral projection but they’re fairly similar!
→ Lucid Dreaming Evolving Again
→ Lucid Dreaming App
→ Tips for astral travel - #4 by Francisco
→ The Magic of Sleep and Dreaming 🛏️