From my own research (and what I remember; I’m no expert),
Using for educational purposes might be okay. Tho I’m thinking a school essay with bibliography; I honestly don’t know where your purpose would fit and if it’s technically okay or not.
fanfiction technically isn’t allowed, even if you’re doing it for free! (I think).
Some people might not care, and even put fan fiction on their office fridge! (e.g. Futurama)
BUT some DO care. Maybe your fanfic goes against what the creator had in mind for the character.
Safest bet is to get written permission from whoever owns the copyright, trademark, whatever-other-relevant-intellectual-property.
And make sure it’s the owner, which might not be the same as the creator…?
Or wear a funny hat, take a pic, and use that as your reference.
May not be the character you had in mind, but it’s safe and you don’t have to wait for a response.
Also, funny hats are funny.
Good luck!
Other, possibly irrelevant but maybe relevant stuff:
P.S. Trademark is different from copyright, but it’s also relevant. E.g. Frankenstein’s monster is public domain (i.e. anyone can use him!).
BUT once you put bolts on each side of his neck, square head, etc., you’re infringing on someone’s trademark(I think Universal Studio’s)!
Cuz even tho they don’t own Frankenstein’s monster, they DO own their interpretation of him.
Also, the Holy Bible is public domain, BUT certain translations are NOT!
Similar thing applies to music. They might not own some old Beethoven song, but they DO own their recording of it!
Grey-areas might also exist. e.g. if it’s not R2D2, but it looks enough like R2D2 that it confuses people and they say, “Oh look! It’s R2D2!” then… even if you win in court, you don’t wanna go to court at all. It’s a hassle, hits your company’s reputation–wait. I think I’m going off topic here. Unless you have bigger dreams…?
But who cares? Some do. If you’re small, they might not.
Tho, I once read about McDonald’s going after what looked like a small burger joint. Oh dear.
Conclusion: safest bet is to get written permission.
Or take a pic of yourself wearing a funny hat and use that as reference