- Home /
Aligning Textures in simple planes
Hi
I have a small and naive problem. I am creating a 2D tower defense game. My method is working with simple textured planes for all the graphics. The camera is fixed from the Y axis. This is working well so far, but now I stumbled upon a problem. My towers have a base, which is static, and a head, which revolves to follow the enemies. To implement this, I use 2 planes fixed one above the other. The tower base is the parent of the tower head. Both of them have 128x128 textures, and both of them have the same scale (0.3x0.3). When I instantiate a tower, there seems to be an alignment shift of the textures, and each tower looks a bit differently:
It seems that my assumptions are a bit naive. What am I doing wrong?
Thanks
Mike
Answer by MrSkiz · Jan 12, 2012 at 03:01 PM
From you screenshot it looks like it could be an effect of perspective. Go for an orthographic camera instead of the default perspective one...
By the way, how do you instantiate the tower? Does the head is instantiated with an offset value ? If parented to the base, it shouldn't, and have to be placed at 0,0,0 relatively to the base.
No, the offset was fine, it was the camera. I guess that the further an object is to the side of the camera image, it is in fact further from the camera, which caused for slight shifts in the alignment
Your answer
Follow this Question
Related Questions
Aligning a GUI.DrawTexture from the right? 1 Answer
Texture on plane not displaying properly 0 Answers
Change Texture of Plane with script 0 Answers
Changing Texture of Plane depending on Position 1 Answer
Large number of objects problem 1 Answer