playMaker

Author Topic: States and Events?[SOLVED]  (Read 8962 times)

mic1991

  • Playmaker Newbie
  • *
  • Posts: 12
States and Events?[SOLVED]
« on: March 29, 2019, 08:56:28 AM »
Hi guys,

I can't get the second state to move to the third state in this FSM, does anyone know what I'm missing?

Playmaker version 1.9.0.p4
Unity 2018.1.9f1
« Last Edit: November 27, 2019, 08:13:12 AM by jeanfabre »

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 808
Re: States and Events?
« Reply #1 on: March 30, 2019, 12:35:09 PM »
The second state is looking for iTween to send a confirmation event at the end of the move.
So, is your pipette reacting to your inputs, then actually moving and reaching its destination? Could be a problem in coordinates, or who knows, even the scale of the game object? Perhaps there's an issue with the placement of the object within a parent's hierarchy?
Test the action with a simple object before applying to the prefab and see if it works properly that way.

mic1991

  • Playmaker Newbie
  • *
  • Posts: 12
Re: States and Events?
« Reply #2 on: April 01, 2019, 09:09:13 AM »
Hi there,

Thank you for the reply.

Yeah the pipette is literally just supposed to 'move to' a vector, it does that fine to be fair. I can't say what happens next in Playmaker, This is made for an Oculus Go and so I haven't managed to get that working in the preview, as I think it needs to detect the device for things to work.

I'll have a crack at a repro in a different setting. What's odd is I used a different second state ages ago, and it happily transitioned into that one.

mic1991

  • Playmaker Newbie
  • *
  • Posts: 12
Re: States and Events?
« Reply #3 on: April 03, 2019, 08:20:31 AM »
The second state is looking for iTween to send a confirmation event at the end of the move.
So, is your pipette reacting to your inputs, then actually moving and reaching its destination? Could be a problem in coordinates, or who knows, even the scale of the game object? Perhaps there's an issue with the placement of the object within a parent's hierarchy?
Test the action with a simple object before applying to the prefab and see if it works properly that way.

Hi again,

Quick question, if I need to send confirmation, does that mean I should add another event to the second state, which is sent to the next state, and then have the state 'ended' by the iTween event not be sent to any state? If so, should I use the same event as the third state?

Broken Stylus

  • Beta Group
  • Hero Member
  • *
  • Posts: 808
Re: States and Events?
« Reply #4 on: April 07, 2019, 06:34:40 AM »
The second state is looking for iTween to send a confirmation event at the end of the move.
So, is your pipette reacting to your inputs, then actually moving and reaching its destination? Could be a problem in coordinates, or who knows, even the scale of the game object? Perhaps there's an issue with the placement of the object within a parent's hierarchy?
Test the action with a simple object before applying to the prefab and see if it works properly that way.

Hi again,

Quick question, if I need to send confirmation, does that mean I should add another event to the second state, which is sent to the next state, and then have the state 'ended' by the iTween event not be sent to any state? If so, should I use the same event as the third state?

The problem is that you need to keep an eye on the iTween. What you could do, if you know how long the tween is always going to last, is cheat by having a Wait action for example, that sends a custom event, but that's dirty. You should really look into the iTween action and the behavior of the game object controlled by it and see if the entirety of the tweening is completed. Sometimes Unity fucks things up with miserable decimals and that is enough to make a behavior fail.
Try another iTween action too. There is simply no reason why this action shouldn't detected the completion of the tweening process.

mic1991

  • Playmaker Newbie
  • *
  • Posts: 12
Re: States and Events?
« Reply #5 on: April 16, 2019, 12:10:37 AM »
Yep lol you're right. Now I just have broken the FSM into separate FSMs. So weird that it doesn't just work! I did try using Wait functions to send the event but no luck with that either. I guess I deserve this for being too lazy to learn more C# though. Cheers

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7620
    • jinxtergames
Re: States and Events?
« Reply #6 on: April 16, 2019, 06:48:21 AM »
Hi.
On the 1st image in the 'Activate' sample in oyster' there is a 'Activate Game Object' (the 2nd one)
it deactivates the owner, which includes the current fsm.
which will disable the fsm, so the 'Send Event' will never happen.

mic1991

  • Playmaker Newbie
  • *
  • Posts: 12
Re: States and Events?
« Reply #7 on: May 06, 2019, 11:17:17 AM »
Hi

Looking at the screenshot you're right, wow i must've made it and forgotten to assign the correct game object.