PlayMaker Updates & Downloads > Share New Actions

Set Game Object as Viewport label...

(1/2) > >>

holyfingers:
Hi there,

I've been re-visiting some of my UI elements this week and thought I'd share my Game Object Label action. It works in a similar fashion to a GUI Label only it uses Game Objects, handy if you're making 3d interface elements, in-scene UI etc.



It takes the world-space position of a target-object and gets the viewport position, then positions a label object at that point at the corresponding world-space including optional offsets.

I've also including some limited functionality from http://wiki.unity3d.com/index.php?title=CameraFacingBillboard#Alternative_Mod so you can have the label align itself with your chosen camera.

Apologies if this already exists somewhere, I'd previously been using 4 or 5 separate actions and a script to achieve the same result and thought this was a bit tidier!

Let me know if you have any problems or spot any mistakes!

Cheers,

Nick 

dblincoeii:
Hi Holyfingers.  I just found this playmaker action.  Looks like what I am needing but I cant seem to get it to do what I need it to.  I have a camera with a canvas and I want text on the canvas to follow the 3d objects screen pos.  Is that what this does?  How should I arrange the objects in my hierachy.  I'm assuming I use ui text.

Any help would be appreciated.  Thanks.

holyfingers:
Hey there,

It's been a long time since I looked at this action but it was more for using 3d objects as a sort of pseudo-GUI, so not not really what you're after I don't think?

I had a quick check in Unity though and Playmaker has actions for converting back and forth between screen and world space, and has actions for Rect transforms...



Scene here has a canvas set to Screen Space - Camera, a sphere and a UI text component, when I move the sphere about the text follows. There are loads of Rect Transform actions for setting offsets on the pivot etc as well...

Hope that helps!

Cheers,

Nick

ivabibliocad:
Followed your template with no succees. Where did you get "sphere world pos" is that a variable? I created one and didn't work....
Where did you get the "rect transform to local" action?

djaydino:
Hi.
Many Custom actions can be found on the Ecosystem.

Navigation

[0] Message Index

[#] Next page

Go to full version