How can I create a UV move tool?

Hey!

Can anybody give me some tips or tell me how i can code a similar move tool like to one in the editor for the gameobjects, but for moving the texture of an object on the x/y axis? I really dont know where to begin. I tought about using the mouses x/y screen pos, but couln’t figure out on how to map it to the materials x/y offset.

Hope somebody can help me out! :slight_smile:

It’s not quite clear what you actually want to do. Note that while editing the UV coordinates of a mesh is theoretically possible, such changes would be lost when the mesh is reimported. Or do you just want to scroll / offset the whole texture? If that’s the case, most materials have a texture scale and texture offset which you can change in the inspector.

If you mainly ask for how to create an editor window or work with the IMGUI system I can recommend you to have a look at my UVViewer editor windows and read through my IMGUI crash course (originally posted here).

Thanks for your reply! @Bunny83

I already have managed to get the functionality seen here: Imgur: The magic of the Internet by mapping the sliders to the materials offset/scale
But my goal is to make the texture in the final game moveable/scaleable with a movetool like for example the Decals in solidworks Visualize or the objcet movetool in the unity Szene window.

Hope this describes my problem a bit better!