Applying texture to part of a mesh - Possible?
I'm struggling to apply a generated texture to part of a generated plane mesh. I'm working on a turn based RPG. In order to show the character's movement range (and how far they can go, and use the currently equipped item) I'm generating a texture, and applying it to a mesh which handles input detection, and is generated on start of the level, depending on the map x and y sizes.
Initially, I was creating a texture the size of the entire map, adding the reachable tile images and a transparent texture to unreachable tiles. This was resulting in a 40mb texture, so I determined the maximum number of tiles on the x & y and created a texture of that size. This brings down the size to 3 mb, but it stretches the texture over the entire mesh. I've attached an image showing tiling.
I can't seem to find anything in the API which will allow be to map the texture between certain UV co-ordinates on the mesh. I've tried tiling with clamp (which creates a blur). Tiling could work, if I could get rid of the blur from clamping, but it would likely be a messy solution. Any suggestions?
You can either use submeshes (explained in the API) to apply a blue area to the tiles around the character and a brown texture for the rest, or just keep one texture with blue and brown areas where you put the UVs for the tiles around the character on the blue pixels of the texture and the UVs of the other tiles on the brown pixels.
Your answer
Follow this Question
Related Questions
Blocky (pixelated) textures on build only (not in editor) 0 Answers
How do I displace mesh texture to always face camera? 0 Answers
Can I add the same UV coordinates to multiple vertices? 0 Answers
Change mesh texture when a line renderer has formed a loop on it 0 Answers
Texture position on multiple mesh 0 Answers