playMaker

Author Topic: HELP - Some Parts of FSM Only Run when Object is Selected  (Read 1646 times)

Ramen

  • Playmaker Newbie
  • *
  • Posts: 5
HELP - Some Parts of FSM Only Run when Object is Selected
« on: June 04, 2019, 07:36:38 PM »
Hi! I'm having a weird issue. Some parts of my FSM run and others don't run unless selected in Inspector. It's weird.

I have an FSM that adds a child to a moving platform and then calculates what should be the speed of the character on top while moving on the platform. Then applies it. It loops this until the player leaves the platform.

When it is not working, the player's speed is at a crawl. When it is working, the player's speed is normal +/- speed from moving platform.

Works:
     - Adding player as child to platform when entering.
     - Removing player from moving platform parent when exiting.

Doesn't Work:
     - Calculating / Applying the correct speed of player while on the platform.

Again this works when the object is selected in Inspector, but it does not work if you build the project or while editing if not selected.

Is there something I can do to start investigating this weird quirk more, or is there something I am missing? I've added some screenshots of FSM to help.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: HELP - Some Parts of FSM Only Run when Object is Selected
« Reply #1 on: June 05, 2019, 06:30:46 PM »
Hi.
On the bottom in the state tab, the is a checkbox called 'Debug' turn this on to see what values are on the variables that are used in the actions.

Also on the variables tab you can select variables and check 'Inspector' then you can see the variables on the Inspector on the fsm component.

Maybe you can make a video if you don't find the issue.

Ramen

  • Playmaker Newbie
  • *
  • Posts: 5
Re: HELP - Some Parts of FSM Only Run when Object is Selected
« Reply #2 on: June 07, 2019, 09:37:00 AM »
Thank you for the reply! I've have debugging and inspector enabled trying to figure this out but to no avail. I took a video of what's happening. It only shows the Game window of Unity, but when I stop for a second, the only change that happens is that I select the game object in the Inspector in Unity. It's odd because only the one part of that FSM doesn't run except when selected. Thanks for helping me out!

https://drive.google.com/open?id=1SWXhdHXNhDYu5NpLh0-bCDTpzQstc_1J

Ramen

  • Playmaker Newbie
  • *
  • Posts: 5
Re: HELP - Some Parts of FSM Only Run when Object is Selected
« Reply #3 on: June 09, 2019, 10:26:41 PM »
Anything that I could do to help with this occurrence?

Thank you!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: HELP - Some Parts of FSM Only Run when Object is Selected
« Reply #4 on: June 10, 2019, 06:14:31 AM »
Hi.
On the set velocity image i can see that "Set Velocity 2D" does not have a varialbe/Value so the action is doing nothing.

But maybe it is better to change the main velocity value from the player.

using "Set Fsm Float" and when jumping off set it back to standard.

if you have a grounded system (raycasts) you could use layers even to determine the movement speed.

If layer is platform set x speed, if layer is floor set y speed, using the Set Fsm Float.

Ramen

  • Playmaker Newbie
  • *
  • Posts: 5
Re: HELP - Some Parts of FSM Only Run when Object is Selected
« Reply #5 on: June 16, 2019, 10:56:28 PM »
I’m sorry about the late reply, but thank you for your help! I didn’t realize that you had commented again.

I will try to look into what you were saying. Hopefully that will help!

Do you think that the issue is that I’m not using Set FSM float and other set FSM commands - not that the FSM isn’t actually going like I thought?

Thank you

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: HELP - Some Parts of FSM Only Run when Object is Selected
« Reply #6 on: June 17, 2019, 04:25:50 AM »
Hi,

 unfortunatly, your video doesn't show anything regarding the editor, so I am not sure it helps.

- is it working when you publish?
- what is the logic about? is it time dependant?

Bye,

 Jean