Search code examples
unity-game-enginetexturesoffsetgameobject

Shift/offset texture used in material on GameObject?


I have a GameObject sphere in my program that represents the Earth.

So I apply a material to it like so:

Earth Material

Using data and a positioning script, I position markers on the globe that represent locations (by longitude and latitude).

Everything seems to work, except that the texture does not line up with the points plotted.

How can I shift the texture so that my data points are on top of the actual locations?

You can see this in the following figure, where South America points are clearly plotted over the ocean between Antarctica and South America in the wrong orientation.

South America Outline

EDIT:

After playing a lot, I found that X offset works, but Y offset does not work. The combination will help me accomplish the task, but it's not wrapping correctly...

Y Offset


Solution

  • To create a new Material, use Assets->Create->Material from the main menu or the Project View context menu.

    Drag your texture into the inspector field and change the Offset variables until you get the desired offset result.

    enter image description here