playMaker

Author Topic: [SOLVED] UI text -- how do I change a simple text with PlayMaker?  (Read 12313 times)

Pawel

  • Junior Playmaker
  • **
  • Posts: 93
I downloaded the uGui actions and samples, I watched the video from Wiki. The simplest task seems impossible to do now...

I see that all other GUI elements working fine -- Sliders, Buttons, Scrollbars, ect ...but how do I change a simple text now with this new scheme?  The text element  shows an error once I attach the PlayMakerUGuiComponentProxy script  (it warns that it is " not a valid UIcomponent")

How do I make a simple text a "Valid UI component", so I can make this text as dynamic as it is shown in the sample? (Where the text below the slider shows the result of changing values).

I don't want any buttons or any other "GUI elements" just the text...
« Last Edit: December 31, 2014, 12:47:32 PM by Lane »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: UI text -- how do I change a simple text with PlayMaker?
« Reply #1 on: December 28, 2014, 05:21:06 AM »
Hi,

What version of Unity are you using? This set only supports the official 4.6 release, Unity 5 is still under beta and unsettled ( likely comply with Unity 4.6 UI in the end hopefully).

I'll be looking at supporting the Unit 5 beta early january, but it could break with every new beta release unfortunatly.


Bye,

 Jean

Pawel

  • Junior Playmaker
  • **
  • Posts: 93
Re: UI text -- how do I change a simple text with PlayMaker?
« Reply #2 on: December 28, 2014, 08:52:59 AM »
It is the 4.6.1f1.

I found a workaround, since I can't figure it out. I attach my text element to one of the "Valid"  UI components -- just disable them from doing anything other than being a parent... Hardly an ideal solution, but it works...

Pawel

  • Junior Playmaker
  • **
  • Posts: 93
Re: UI text -- how do I change a simple text with PlayMaker?
« Reply #3 on: December 28, 2014, 06:45:28 PM »
I think the main issue is that the UI Text objects that are added by Unity are seen as ordinary game objects. They are not recognized as UI Text by Playmaker.

Or am I missing something?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: UI text -- how do I change a simple text with PlayMaker?
« Reply #4 on: December 28, 2014, 07:34:20 PM »
Target the Text component, not the GameObject.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Pawel

  • Junior Playmaker
  • **
  • Posts: 93
Re: UI text -- how do I change a simple text with PlayMaker?
« Reply #5 on: December 29, 2014, 04:42:13 PM »
Lane,

I can only set property to objects, not their components...
The object I create using "GameObject->UI->Text" have their Object Type set as "UnityEngine.GameObject" not as "UnityEngine.UI.Text"

I think this may be a bug... Is it? Or am I missing something...

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: UI text -- how do I change a simple text with PlayMaker?
« Reply #6 on: December 29, 2014, 05:15:56 PM »
You can use Set Property to target the Text component directly and change any of its public variables... rather than dragging the GameObject itself, drag the Component.

Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Pawel

  • Junior Playmaker
  • **
  • Posts: 93
Re: UI text -- how do I change a simple text with PlayMaker?
« Reply #7 on: December 31, 2014, 10:45:57 AM »
Thanks Lane. I will investigate this method.

Happy and prosperous New Year!

Pawel

  • Junior Playmaker
  • **
  • Posts: 93
Re: UI text -- how do I change a simple text with PlayMaker?
« Reply #8 on: December 31, 2014, 12:07:02 PM »
It works great. It does not have the same simplicity as previous text setup, but it is more powerful. For anyone who is struggling with this here is a quick visual how to control text via variable. (The FSM is attached to a text game object created using menu Game Object > UI > text)