Position your UI, using screen space! [Tutorial][C#] - Unity tutorial 2019

preview_player
Показать описание
Widely used effect to have your UI, in screen space, follow something in the world space.

--- Livestream alert ----
I'm live every Saturday morning, come say hello

Join our community, chat with other developers, share your progress and ask a couple of questions

#gameDev #unityEngine #unityTutorial

___|Personal Socials|___________________________

@N3K_Michael
_______________________________________________
Рекомендации по теме
Комментарии
Автор

Thank you. While there are a bunch of videos in this subject, you managed to explain in it under 15 minutes. That is the sole reason I watched this one. Was not disappointed!

MadMikeAU
Автор

UI stuff always felt very clunky to work with for me. Your stuff makes me learn a lot.

mystirboy
Автор

THANK YOU for this lol, I was slamming my head against a wall for hours trying to figure out how to convert world space to canvas space and this works *perfectly*

theodorescontras
Автор

simple but very good tutorial. Especially because you mentioned the redrawing "issue" of non-static canvases. That is rarely ever mentioned anywhere.

aldigangster
Автор

You can change the render settings of the 3d object/text so that it will be on top of everything else and always fully visible/readable. The screen space solution is still better in this case, but the other statement is a bit misleading.

rpfake
Автор

Thanks You Brother ! You Saved My Azz xD

GameOnBudget
Автор

Thank you. I was looking for a way to move a UI element to specific places and I would not have discovered the WorldToScreenPoint function in time to finish the game for the Jam i am taking part in.

issacthompson
Автор

Thank you so very much for this tutorial! It's simple and well explained. ^o^

maryneko-chan
Автор

Thank you for this video. Could we also make it so screen space UIs can be overlapped like gameobjects do? For example in Lineage 2 game, when NPC objects are being covered by buildings or trees or something, their name tags are also covered

niksongg
Автор

This was great, it wasnt exactly what i was doing but it made me understand how it works and figure it out by myserlf

oscarmartinez-zbyx
Автор

Ajudou demais mano, simples e eficiente, te amo

OnWeek
Автор

Great tutorial. It works just as you showed, but if you're object is off the screen the icon slowly makes it's way into the centre of the screen until i move to see the object again. is there a way to kill this if the object is not on screen?

whidzee
Автор

Hi there, it worked properly but only in FixedUpdate! In Update doesn't work as expected.

alexbarra
Автор

How would you write the script for a 2d game?

williamallen
Автор

script works but it's glitchy on my project. It's flickering and doubles while it's on a moving object

Geckotr
Автор

What would be good if you had a sprite image that moves to and locks on to that sprite image like in F16 flight sim game.

random_precision_software
Автор

Great tutorial! How would you make it scale by distance? So that it keeps its own relative size above the "Enemy" position, and gets smaller the further the enemy moves from the camera in world space, and returns to a scale of 1 when the enemy is right ontop of you.

Darkon
Автор

Doesn't work, object reference not set to an instance.

demis
Автор

using UnityEngine;

public class textHover : MonoBehaviour
{
[Header("Tweaks")]
[SerializeField] public Transform lookat;
[SerializeField] public Vector3 offset;
[Header("Logic")]
Camera cam;

// Use this for initialization
void Start()
{
cam = Camera.main;

}

// Update is called once per frame
void LateUpdate()
{
Vector3 pos = + offset);

if (transform.position != pos) { transform.position = pos; }

//
//transform.rotation =
}
}

AuditorsUnited