I have a GUIText element that I’m positioning on top of a graphic. The position looks fine at first, but I soon realize it’s only staying in the correct place for a single resolution. It’s not necessarily a shock that elements shift against the background when the resolution changes, I’m just not sure what the fix for this is. Searches for the problem find a variety of issues that are basically unrelated to the problem I’m having.

I set it up by putting a GUIText element on top of a graphic in the scene and made sure it lines up visually. The coordinates for the GUIText are X: .165 Y: -1.11344 Z: 0. The GUIText is a child of the graphic to which I am aligning it.

Is there an easy way to do like an offset for this GUIText element off of the parent element? The strange thing to me is that I have another image behind the GUIText’s parent image and the parent and this other, further back image, stay perfectly aligned with eachother at any resolution.

Appreciate the help.

GUIText lives in Viewport space while the parent object (apparently) lives in world space. It might be possible to make a parent/child relationship work, but I’d approach the problem differently:

  • Break the child relationship so you have two, top-level game objects.
  • Place an empty game object at the position you want to anchor the text relative to the object that was the parent.
  • Make the empty game object a child of the previous parent object.
  • Make sure the anchor and alignment is set correctly so that when the anchor is at the empty child’s position, you get the layout you want.
  • Make sure the pixel offset is set to (0,0).
  • Put the following script on the GUIText
  • Select the GUITExt in the Hierarchy view, and drag and drop the empty game you place for position on the ‘toFollow’ variable.

#pragma strict

public var toFollow : Transform;

function Update() {
     transform.position = Camera.main.WorldToViewportPoint(toFollow.position);
}

If your objects move around, you may have to change Update() to LateUpdate() to get smooth movement.

Honestly you guys get so technical??

Any new comers?

Try this video it helped me and it will help you and it is way more easy:

:smiley:
CHEERS