About device temperature while running games on mobile

I have a project which is fully created by bleprints,no c++.And I package my game to ios and android,and then running on the real devices.For ios,I’m testing it on iphone6 and iphone7plus,for android,I’m using galaxy s7 edge(snapdragon 820,6.0。1).After running for about 10 minutes or less,all my devices’ temperatue go very high,maybe 50℃ and above.So for android,the CPU maybe slowed down due to the high temperature,so the fps drops down quickly.
How can I prevent this high temperature?If I write the game logic into c++ code,will this get improved?Thanks a lot!

Maybe limit the framerate? Lower the shadows accuracy and graphics quality overall? Hard to guess as you haven’t provided a lot of information. Rewriting the code in C++ will improve the performance for sure.