Hi, I’m building a car racing game and everything was going good until my brain had the idea to make a minimap except not any minimap but a Mario kart like one. The issue is I don’t have a clue where to start. Is anyone here able to help?
I really like this guy’s approach: start with the smallest possible incremental step and build up from there.
There are also ten billion “minimap” tutorials out there… they can give you a really good idea of what is involved (coordinate space transforms, scaling, etc.).
Imphenzia: How Did I Learn To Make Games:
basic idea for minimaps,
you remap values from one range (like the race track bounds)
into another range (like minimap UI image bounds)
Example image below:
your world position is 256,128 (x,y)
divide 256 by race track bounds: 256/512=0.5
divide 128 by height: 128/512 = 0.25
then you know that x position is at middle of the in minimap (0 is left edge, 1 is right edge, 0.5 is in the middle)
and for y its 0.25 (when 0 is top and 1 is bottom), so you can get your minimap position
using those normalized values.
or how to remap values,
Have a iso camera looking down. At scene start hide everything except the track. Render the camera to a texture. Now you can convert cordinates from the world to the camera cord system by using unity built in functions