Hello, how do i create object 2 that will be in almost in center of the map, then how do i make object 2 move around minimap in lower scale like player move around map
There’s like ten billion tutorials for this out there, and underneath it all it is simply a rectangular rescaling transform: you scale from one rect (your world) to another rect (your minimap).
If it’s more than a simple minimap coordinate transforms, then explain further.
If your game moves through 3D and you want the minimap from the top, just disregard the y value.
In other words, from 3D to 2D for a top-down minimap:
x → x
z → y
Now from (x,y) above you can make your 2D rectangle-to-rectangle reduction and you have your minimap position.
If you have a NaN that means you divided by zero. Don’t do that. If you have code that computes a divisor, guard that code against being zero before blindly dividing by it.