playMaker

Author Topic: Activating a game object problem.  (Read 13543 times)

kanae

  • Junior Playmaker
  • **
  • Posts: 52
    • View Profile
Re: Activating a game object problem.
« Reply #15 on: October 26, 2014, 09:38:10 PM »
Explaining alpha masks would be a completely separate material creation thing and not a playmaker thing, at least now how I'm suggesting it.

Google is your friend.  http://forum.unity3d.com/threads/glow-effect-in-free-version-unity.78093/

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #16 on: October 26, 2014, 09:55:41 PM »
I see but I think what I'm trying to explain is simply turning on another shader or just switch the basic shader it has right now to a different one. So the picture that I posted would be the result when the player triggers a event that turns on the button.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #17 on: October 29, 2014, 12:34:43 AM »
Drag the Game Object directly into the Activate Game Object action since you're working with scene objects.

Didn't work with or without a variable. I got somewhere with Enable Behaviour action, but how would that work with three buttons?

kanae

  • Junior Playmaker
  • **
  • Posts: 52
    • View Profile
Re: Activating a game object problem.
« Reply #18 on: October 29, 2014, 02:13:20 AM »
Still an issue?  Not sure what methods you tried, a dirty but effective way would be starting the object as activated, have it set it's own name with "Get Owner", then have it de-activate itself, then use the name variable to activate it later.  Just make sure you uncheck reset on disable otherwise it will reset and keep running that same function.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #19 on: October 29, 2014, 11:25:51 AM »
Still an issue?  Not sure what methods you tried, a dirty but effective way would be starting the object as activated, have it set it's own name with "Get Owner", then have it de-activate itself, then use the name variable to activate it later.  Just make sure you uncheck reset on disable otherwise it will reset and keep running that same function.

It's a simple puzzle though, it's only going up to a trigger(the control deck) enabling three buttons so when all of them are pressed(only set up like a OnTriggerStay) then a door is destroyed. How would that work?

kanae

  • Junior Playmaker
  • **
  • Posts: 52
    • View Profile
Re: Activating a game object problem.
« Reply #20 on: October 29, 2014, 04:02:07 PM »
Sounds like a design question?  where are you stuck exactly?

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #21 on: October 29, 2014, 04:06:00 PM »
Sounds like a design question?  where are you stuck exactly?

Having the control deck object FSM being able to activate all three buttons when Enable Behaviour only activates one object FSM. 

kanae

  • Junior Playmaker
  • **
  • Posts: 52
    • View Profile
Re: Activating a game object problem.
« Reply #22 on: October 29, 2014, 04:51:55 PM »
Just use it multiple times, use more variables if you have to...

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #23 on: October 30, 2014, 11:02:47 PM »
As for triggering all three buttons to destroy or unlock the door, how would that be done?

kanae

  • Junior Playmaker
  • **
  • Posts: 52
    • View Profile
Re: Activating a game object problem.
« Reply #24 on: October 30, 2014, 11:09:10 PM »
have an fsm track three bool variables, when all are true (each button has been set to 'true') then you can use "activate object" and make the door dissapear (activate object is used to also de-activate them), or you can destroy it with destroy gameobject which is actually a slight bump in resources.

You can also add a sound.  If you want to.  To animate the door is a whole other thing you would want to google.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #25 on: October 30, 2014, 11:21:27 PM »
have an fsm track three bool variables, when all are true (each button has been set to 'true') then you can use "activate object" and make the door dissapear (activate object is used to also de-activate them), or you can destroy it with destroy gameobject which is actually a slight bump in resources.

So if I want to stick with a "tracking bool variable" approach, would that mean that I would have to add a action called that? Or would I have to add a few more actions onto each trigger button fsm before I make each variable(suspecting you mean local vars)?

You can also add a sound.  If you want to.  To animate the door is a whole other thing you would want to google.

I did mess around with simple door turning animation in another prototype awhile back, but it is something I will look into. I had an idea to alter or add empty object/point to the camera so a mini cutscene would appear, don't know how to do that though.

kanae

  • Junior Playmaker
  • **
  • Posts: 52
    • View Profile
Re: Activating a game object problem.
« Reply #26 on: October 30, 2014, 11:29:35 PM »
You can track the buttons however you want.  But either way you will need to have each button trigger a variable update.  Where you actually calculate that for the door opening doesn't matter as long as an FSM somewhere is doing the logic.  For clicking on the buttons you can use "bool flip" that way if they click it again the bool goes back to false...  the action "bool all true" will do the logic for you.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #27 on: October 30, 2014, 11:41:14 PM »
You can track the buttons however you want.  But either way you will need to have each button trigger a variable update.  Where you actually calculate that for the door opening doesn't matter as long as an FSM somewhere is doing the logic.  For clicking on the buttons you can use "bool flip" that way if they click it again the bool goes back to false...  the action "bool all true" will do the logic for you.

So that would mean for the buttons they would have to use bool flip for each before making them local variables? If so, then that would mean when I would add the action bool all true before adding animation or destorying the door? Since bool all true   would have to be added to the FSM on the door right?

kanae

  • Junior Playmaker
  • **
  • Posts: 52
    • View Profile
Re: Activating a game object problem.
« Reply #28 on: October 31, 2014, 12:30:40 AM »
with your variables it just depends on how you plan to use them

FSMs can exist on any object, have you watched the tutorial video on managers?  You can create FSMs whose sole function is to remotely do logic like this.  It really doesn't matter where/when you are defining these variables as long as both the variables and the "all true" function are all running and available when they need to be.

That's also what "every frame" is for, so in the case of bool "all true" it will keep checking until all are true.  Don't restrict yourself to thinking too linearly!  You could do this in a lot of different ways.
« Last Edit: October 31, 2014, 12:43:37 AM by kanae »

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #29 on: October 31, 2014, 01:49:20 AM »
To double check, what you mentioned had to do with global variables? Therefore all three global variables would be objects that aren't empty? If so, is it necessary to make the buttons prefabs?
« Last Edit: October 31, 2014, 01:20:07 PM by coffeeANDsoda »