Ishyna |
Man that's a tough question. Some spells will tell you like charm. On a crit success they are aware of the spell and it's purpose. By that metric getting hit with a spell does not necessarily mean you're aware. It's not a great guideline but it's a starting point. After that your DM will have to decide.
If it was me it would depend on whether the target saw you cast the spell and if the spell effects (visual, auditory, damaging, etc). Obviously they would be aware they just got hit by a fireball. If they aren't moving they may not notice they just got slowed. Pretty subjective. Personally I'm a fan of having a rule for everything but not everyone likes that.