The answer is personification if need to explain the sun can’t come out to play (personification is when animals or objects are given abilities that only human can do.
It's giving the weather a human like action, another example is the thunder clapped loudly . sorry if this is incorrect , but I'm pretty sure I'm right: ) Have a great night.