playMaker

Author Topic: How to simply get a variable from a component? [SOLVED]  (Read 1307 times)

Gatsu

  • Playmaker Newbie
  • *
  • Posts: 14
How to simply get a variable from a component? [SOLVED]
« on: November 05, 2017, 02:37:18 PM »
Hi, I have spent last couple hours trying to read a variable of a GameObjects component but in playmaker. I have a GameObject with a "ScoreCounter" component attached which is a MonoBehaviour extended class. I can find this GameObject by its tag but I am unable to get it's component called "ScoreCounter". This component contains a variable named "killCount" which I want to use with playmakers "Int Compare".

Below you see I am using Get Component but it's not allowing me to pick a component that is on the GameObject stored in "score". There is no input field which lets me pick a component. This is very confusing to me, how does this work? Is this a bug?

« Last Edit: November 05, 2017, 04:21:39 PM by djaydino »

Gatsu

  • Playmaker Newbie
  • *
  • Posts: 14
Re: How to simply get a variable from a component?
« Reply #1 on: November 05, 2017, 03:11:39 PM »
and I figure it out after typing, I have to create a special type of variable that is of type "ScoreCounter" which then can provide the "killCount" variable that I am looking for. Thank you.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: How to simply get a variable from a component? [SOLVED]
« Reply #2 on: November 05, 2017, 04:22:36 PM »
Hi,
Thanks for answering your own question, it can always be useful for someone else.  ;)