- Home /
Texture offset problem
Dear Unity Community,
I have a character that moves by mouseclick, actually it doesnt move, the texture of the background plane moves in the opposite direction then it looks like the character is moving. Im using a script to determine the distance between mouseclick and character and then apply a texture offset with this function (C#):
this.renderer.material.mainTextureOffset += viewingdirection;
the texture is moving in the right direction and it looks just fine. However when the texture reaches the end of the picture, it has an ugly border and starts over again (surprise!). To solve that i added a "smooth" border in photoshop, so that its not visible anymore. Anyways, unity seems to have a different border at bottom and top then at left and right of the picture. its hard to explain. Take a look at this image:
A bit right from the middle of the image is the border between left and right side of the image (picture's vertical end!), the very clear horizontal line is the border between top and bottom side of the image. I added a stroke in photoshop so that it is better visible (stroke of 3 pixels AT ALL 4 SIDES!!).
In the bottom half of the picture is another screenshot. This time i flipped the image 90 degrees (in photoshop, not unity!) still with the same 3 pixels stroke. Now the funny thing wich has been driven me crazy is: The clear line is still at the same place! If the image is not flipped, the line is between the top and bottom of the image, if the image is flipped 90 degrees, the line is between the right and left of the image but it is still the same picture with the same border all around it in every direction. Hope you understand what i mean.. Really hard to explain!
Does anyone have an idea on how to solve this?
thanks in advance -Sacrosanct
Your answer
Follow this Question
Related Questions
can't offset normal map 1 Answer
Offset detail texture in c# 1 Answer
SetTextureOffset not visible 1 Answer
How I make finger touch move texture offset 0 Answers
Having Trouble with Texture Tiling and offset values. Very specific case. 2 Answers