playMaker

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

Grendelbiter

  • Playmaker Newbie
  • *
  • Posts: 11
Trigger Event Store Collider not working
« on: November 15, 2017, 02: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: 7615
    • jinxtergames
Re: Trigger Event Store Collider not working
« Reply #1 on: November 15, 2017, 06: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: 11
Re: Trigger Event Store Collider not working
« Reply #2 on: November 16, 2017, 09: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: 7615
    • jinxtergames
Re: Trigger Event Store Collider not working
« Reply #3 on: November 17, 2017, 04: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.

Grendelbiter

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Trigger Event Store Collider not working
« Reply #4 on: November 18, 2017, 03:24:28 AM »
I did put breakpoints on every action, but there's not any more to see there, just that the Trigger Event fires as it should but no Gameobject is being stored.

My project is way too large to send so I'll put together a mini project and see if I can reproduce it there.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7615
    • jinxtergames
Re: Trigger Event Store Collider not working
« Reply #5 on: November 18, 2017, 10:10:42 AM »
Hi.
Ok, pm me a link when you uploaded.
If its to hard, maybe we can use teamviewer or something.