Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Question Mario Kart like minimap.. HELP.

Discussion in 'Scripting' started by rehmanansari0901, May 22, 2024.

  1. rehmanansari0901

    rehmanansari0901

    Joined:
    Jan 16, 2024
    Posts:
    1
    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?
     
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    39,357
    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:

     
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,546
    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,
    https://forum.unity.com/threads/re-map-a-number-from-one-range-to-another.119437/

    upload_2024-5-22_16-59-27.png
     
  4. Max-om

    Max-om

    Joined:
    Aug 9, 2017
    Posts:
    502