playMaker

Author Topic: Sent Events to Inactive Game Objects?  (Read 2124 times)

Lubeaz

  • Playmaker Newbie
  • *
  • Posts: 4
Sent Events to Inactive Game Objects?
« on: September 26, 2016, 03:14:30 PM »
Hi there! (I'm spanish...so, sorry for my poor english)

I'm pretty new to coding and using Unity3D and I started with Playmaker last week. So far, so good I must say, pretty happy with the things I've achived so soon without having a clue on programming!

Ok then, I've attached some pictures to show you guys my problem the clearer I can.

The issue is this: I have set an Horizontal Scroll Menu (inside a Canvas) where the player can select some items. As you can see, I've used free assets from the Unity Asset Store to try things around.

The items as you can see in the first picture attached should be locked until the player gets the designed object to unlock them (the coin in this case).

To make this work, I set a black Raw Image with the Locked text over the Item Button that you have to press.

With some FSM I manage to achived the desired result. The player picks the coin and this sent an Event that triggers Destroy the Object (an Action in Raw Image), leaving the Item Button on sight.

Everything works just fine, so...where's the problem?  Well, the thing is that the Scroll Menu is Inactive until the player steps on the Controller placed on the floor (Picture 3). So, when I try to make it work, it doesn't. The Scroll Menu has to be active all the time if I want the triggered Event to reach the Locked raw image inside the Menu.

Any suggestions?  Thanks!


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Sent Events to Inactive Game Objects?
« Reply #1 on: September 27, 2016, 02:12:13 AM »
Hi,
What you can do is to use a bool for example.
you can use "set fsm bool" to set a bool and once you activate your object let i check that bool to lock/unlock
The variables can be changed while inactive

Lubeaz

  • Playmaker Newbie
  • *
  • Posts: 4
Re: Sent Events to Inactive Game Objects?
« Reply #2 on: September 27, 2016, 07:17:40 AM »
Hey thanks for the quick response!

I was trying to sleep last night thinking about this and I thought: maybe with variables...maybe a did a stupid question. Well, affirmative hehehe

Anyway, I didn't know you could "set fsm bool" and that's cool. I'm not a programmer and I don't really get how or where should I use this action, or even make this thing work with boolean parameters. But I'm still learning, I'll figure it out. Now I know where to look :)


djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Sent Events to Inactive Game Objects?
« Reply #3 on: September 27, 2016, 11:39:36 AM »
Hi,
There is no stupid question if you don't know the answer  ;)

You could also use global variables if you need several fsm's to work with a certain variable, but in this case its better to use the set fsm action.