That too.Also, adding to what Gare said, it's sometimes used in other ways, too. Like... robotic / artificial speech is often rendered in only katakana, so it's not uncommon to see entire strings of katakana being used for stuff that would normally use all three written styles when the character in question is a robot or something. Also, since katakana tends to convey a sort of foreign / artificial nuance sometimes, it can sometimes be used when someone is using a kanji word that they don't necessarily fully grasp the meaning of. For example:
Person A: 私は学生です。
Person B: ガクセイは何ですか?
In that scenario, person B doesn't really understand the meaning of the word 学生, and is just mimicking the sequence of sounds that they heard, so it can be rendered in katakana to stress that lack of understanding, being that only kanji carry inherent meaning in and of themselves. If you translated it into English, it might become something like, "A stu... dent?" Like... it sounds like someone's chewing over the syllables, trying to work out what they might mean. It doesn't always happen, and it's a stylistic choice, but you see it quite often.
Ultimately, like Gare said, while there are general rules about what script should be used in what situations, they are quite often mixed up for various reasons, so take those rules as general guidelines rather than something unbreakable.![]()