playMaker

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

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Activating a game object problem.
« on: October 17, 2014, 11:49:20 PM »
I have a object with a trigger box that I want to use in order to turn on another object for a puzzle. And with that box, I set up a trigger event to flow into Activate Game Object in another state. Here's the problem, the object I want to enable doesn't activate/turn on.

Does that mean I have to set up a colliding system that relies on a global variable? Or am I missing another state to make it work? Bare in mind the object I want to turn on has a FSM that's disabled.
« Last Edit: October 18, 2014, 03:21:23 PM by coffeeANDsoda »

kanae

  • Junior Playmaker
  • **
  • Posts: 52
    • View Profile
Re: Activating a game object problem.
« Reply #1 on: October 18, 2014, 05:17:33 PM »
You have to store the game object you want to enable inside a variable - then call it with another FSM, that's the only way to activate a disabled object, using playmaker.  at least that's what I think I've figured out today, after much of the same issue...

the other way is to child the object and call it with another FSM in the same structure, but that could get messy organization wise

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #2 on: October 18, 2014, 08:02:26 PM »
You have to store the game object you want to enable inside a variable - then call it with another FSM, that's the only way to activate a disabled object, using playmaker.

So would that mean I have to make another trigger plus another FSM for the boxed trigger to turn on the puzzle?

kanae

  • Junior Playmaker
  • **
  • Posts: 52
    • View Profile
Re: Activating a game object problem.
« Reply #3 on: October 18, 2014, 08:41:27 PM »
Just have a state in/with your trigger that stores the gameobject in a variable then activates that gameobject under your trigger events

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #4 on: October 18, 2014, 10:12:20 PM »
Just have a state in/with your trigger that stores the gameobject in a variable then activates that gameobject under your trigger events

To make sure, when I create the variable inside that FSM, do I set the Variable Type to GameObject? Because I tried making it a global variable with the object itself and it doesn't work.
« Last Edit: October 18, 2014, 11:22:53 PM by coffeeANDsoda »

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #5 on: October 20, 2014, 02:28:01 AM »
Also, this is what I don't understand. Correct me if I'm wrong, but why would I need to store a variable collider in trigger event, and then use Activate Game Object? Because wouldn't creating a variable(global or local) with the object included be doing the same thing?

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Activating a game object problem.
« Reply #6 on: October 20, 2014, 04:13:18 AM »
Drag the Game Object directly into the Activate Game Object action since you're working with scene objects.

Or you could use a variable (it doesn't matter if you do it either way), just create one and drag the game object into there instead, then specify that variable on the Activate Game Object action. And yes, of course it would need to be a Game Object variable since you're dealing with a Game Object.

To activate the FSM you need to use Enable Behavior and drag the FSM script from the inspector into that slot.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #7 on: October 20, 2014, 12:14:33 PM »
To activate the FSM you need to use Enable Behavior and drag the FSM script from the inspector into that slot.

But on two separate states right? Just to make sure, cause I don't see how it would work on just one whole state.

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2488
  • Yup.
    • View Profile
    • Cleverous
Re: Activating a game object problem.
« Reply #8 on: October 20, 2014, 12:31:53 PM »
There's nothing wrong with using two, if that works.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #9 on: October 22, 2014, 02:40:38 PM »
I don't understand how I could enable a light as well as a custom shader. But this is what I have during gameplay.


coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #10 on: October 25, 2014, 01:12:54 PM »

To activate the FSM you need to use Enable Behavior and drag the FSM script from the inspector into that slot.

Would work best on the state having Activate Game Object action? Or the Enable Behavior action being on the Button FSM that is disabled at the moment?

Plus I left out that I want to use two more buttons in order to make the box trigger turn all of them on. Because I thought I would kind of keep the puzzle simple and turn on all three buttons regardless of what order they are in.

By the way , isn't there a way to script a simple glowing shader in Unity indie? So each button glows when you turn them on.

kanae

  • Junior Playmaker
  • **
  • Posts: 52
    • View Profile
Re: Activating a game object problem.
« Reply #11 on: October 25, 2014, 03:00:48 PM »
For the glow you could try adding an alpha mask with a faded circle as a 2d texture.  Have you tried looking on the asset store for a shader for Unity free?

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #12 on: October 25, 2014, 03:16:54 PM »
For the glow you could try adding an alpha mask with a faded circle as a 2d texture. 

Alpha mask being a action? I had in mind of creating shaders by myself since I already made my own meshes and textures.

kanae

  • Junior Playmaker
  • **
  • Posts: 52
    • View Profile
Re: Activating a game object problem.
« Reply #13 on: October 25, 2014, 03:39:54 PM »
well there's actually a lot of info about writing unity shaders on the web from what I've seen, but I'm really not sure you'll get an answer about shaders here, i know i can't help you with that.

coffeeANDsoda

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
Re: Activating a game object problem.
« Reply #14 on: October 26, 2014, 07:06:54 PM »
I see. As for alpha mask what do you mean? I looked in actions in playmaker and shaders and I can't find it.