playMaker

Author Topic: Trigger Enter > GUI Text + Button Press confusion  (Read 3134 times)

ShinfoKensei

  • Playmaker Newbie
  • *
  • Posts: 22
Trigger Enter > GUI Text + Button Press confusion
« on: October 24, 2014, 02:34:53 PM »
So I'm a bit confused. I've got a prefab with a box collider.

The idea is to enter the collider, GUI text appears, you can press a button and an action happens (in this instance, deactivating one game object, and activating another). My fsm looks like the following:

State 1 (Transition: Trigger Enter) - > Trigger Event "On Trigger Enter".
State 2 (Transition: Button Down) - > Get Button "Use" + Set Gui Text "Press 'E' To Use"
State 3 (Transition: Finished) - > Activate Game Object "False" + Activate Game Object "True".
State 4 - > Finish FSM

Now, without the get button state, using just trigger enter, this all works fine. The problem lies with the second state. Trying to use Get Button doesn't seem to do anything.

It says input button not set as an error, but I'm pretty sure it is?

The FSM: http://i.imgur.com/DgwFRzK.png


Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Trigger Enter > GUI Text + Button Press confusion
« Reply #1 on: October 24, 2014, 04:38:32 PM »
The Negative and Positive button are the same button.

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

ShinfoKensei

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Trigger Enter > GUI Text + Button Press confusion
« Reply #2 on: October 24, 2014, 10:36:07 PM »
The Negative and Positive button are the same button.

Only use Positive.

Aye. I did try that (and that's what it currently is), and many other ways. It doesn't seem to be the problem.

Here are my states: http://i.imgur.com/FFd3iZc.png

Also, the GUI text appears at the start of scene, not just in the trigger.

ShinfoKensei

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Trigger Enter > GUI Text + Button Press confusion
« Reply #3 on: October 25, 2014, 07:32:40 AM »
Ok figured it out. I had the button to be pressed as a string variable called "Use" (followed a Hutong youtube tut for that), I just manually entered the Use name, which is the name of my Input for "E" and it works. :)

ShinfoKensei

  • Playmaker Newbie
  • *
  • Posts: 22
Re: Trigger Enter > GUI Text + Button Press confusion
« Reply #4 on: October 25, 2014, 10:49:40 AM »
Ok new problem now >_>

So activate/deactivating the objects was working for a bit, but I need to make this a prefab, and because my two buildings are ProBuilder created, it's not liking being in a prefab.

So, I'm trying to create object (the new house), and destroy object (old house).

Doing this just causes unity to crash.