Actually im kinda lazy to make some ESP layer from scratch, so i usually using other people works from github and adjust it to my needs (changing driver, updating offsets and etc). If you're interested in this kind of field, you may need to hop on Hacking forum. Here's some reference for basic Hacking Unity Games including how's ESP work in Unity:
Hacking Unity Games
Usually on UE4 you just need to find Gworld and Gnames and from there you can point player offsets but its kinda differ in Unity. You may get some Player-Pos inside generic AssemblyCSharp.dll. Never tried it on myself because i usually making ESP for UE games. Oh yeah, you can browse some pre-existing people works and look it up for basic understanding. Just search it on the forum or browse github like i does :v