playMaker

Author Topic: Trigger Event Store Collider not working  (Read 59 times)

Grendelbiter

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Trigger Event Store Collider not working
« on: November 15, 2017, 12:28:17 PM »
Hi,

I'm trying to pick up a gun in VR when entering the Trigger Collider of the handle. I have a script from VRTK to autograb the gun on each Controller, disabled at start. I have a simple FSM with the Start state listening for a Trigger Enter with the Trigger Event action on it. It's set to the tag of the Controllers and it transitions to the next State fine, it doesn't store the Gameobject it collided with though, so the enable Script Action on the next State throws a Null Exception. Here's a pic of my setup: https://imgur.com/O2wJfXM

Any ideas why? Maybe because the Controllers are a child of another GO?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2247
    • View Profile
    • jinxtergames
Re: Trigger Event Store Collider not working
« Reply #1 on: November 15, 2017, 04:54:33 PM »
Hi,
Strange, i can't try in vr but in 2d/3d they are working.

Can you show your fsm/states/actions (video or picture) and anything that could be useful.

also this video might help you with Debugging :


Grendelbiter

  • Playmaker Newbie
  • *
  • Posts: 10
    • View Profile
Re: Trigger Event Store Collider not working
« Reply #2 on: November 16, 2017, 07:12:04 AM »

Here's the first State: https://imgur.com/O2wJfXM

and the second State: https://imgur.com/KPlL77s

and here's a shot of the inspector of one of the controllers: https://imgur.com/D4lQuwA

What is not shown is that the collider on the handle is set to Trigger. It detects a Trigger event if I move the controller into the handle and fires off the On Trigger Event and transitions to the next State. Playmaker doesn't show any error but there is this error in the Console:

Code: [Select]
NullReferenceException
HutongGames.PlayMaker.Actions.EnableScript.OnEnter () (at Assets/PlayMaker Custom Actions/ScriptControl/EnableScript.cs:62)
HutongGames.PlayMaker.FsmState.ActivateActions (Int32 startIndex) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:201)
HutongGames.PlayMaker.FsmState.OnEnter () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/FsmState.cs:169)
HutongGames.PlayMaker.Fsm.EnterState (HutongGames.PlayMaker.FsmState state) (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:2603)
HutongGames.PlayMaker.Fsm.Continue () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:3305)
HutongGames.PlayMaker.Fsm.Update () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/Classes/Fsm.cs:1854)
PlayMakerFSM.Update () (at c:/Users/Alex/Documents/Unity/Playmaker/Projects/Playmaker.source.unity/Assets/PlayMaker/PlayMakerFSM.cs:509)

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2247
    • View Profile
    • jinxtergames
Re: Trigger Event Store Collider not working
« Reply #3 on: Today at 02:48:42 PM »
Hi,
The error comes from this :

Code: [Select]
var gos = Fsm.GetOwnerDefaultTarget(gameObject);
if (gos == null)
{
Debug.LogWarning("missing gameObject: "+ gos.name);
Finish();
}
It is because gets the game object and if there is no object it will return a null.
Then it says if it is null send a warning that the gameobject is missing.... + the gameobject name.
the last part gives the error because there is no object so it can't get the name.

Anyway, so the trigger action does trigger but it does not store the object somehow.
Have you tried setting breakpoints to see what happens?

If you want i can have a look, save the project somewhere and pm me the link.