playMaker

Author Topic: Prefab 2d velocity problem [SOLVED]  (Read 237 times)

Sketch

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Prefab 2d velocity problem [SOLVED]
« on: June 08, 2021, 12:38:58 PM »
Hi guys,

I don't think this is a playmaker issue but it's my main tool, soooo...

I dragged my character who has several playmaker fsm's attached (movement, jump, run, etc) into the prefab folder. I guess this was a massive mistake or something, because now I have this weird issue where his speed is not being set correctly.
I have a run skill where you hit the direction key twice and he runs (using set velocity 2d). Now, the fsm is working, his animation changes for example, but he isn't speeding up at all. Is this a problem with him now being a prefab? I can't for the life of me work out why this would happen at all. Weirdly, all his other skills (which mostly use force and move rigidbody) all work perfectly. Does anyone have any ideas why isn't this one working?
I'm sure it's something stupidly simple in the prefab settings...
Thanks in advance
« Last Edit: June 09, 2021, 10:41:31 AM by Sketch »

wetcircuit

  • Full Member
  • ***
  • Posts: 120
    • View Profile
    • wetcircuit.com
Re: Prefab 2d velocity problem
« Reply #1 on: June 08, 2021, 12:47:50 PM »
Maybe not your prefab, but an in-scene manager that has lost its reference to the figure? Or the figure's fsm?

I'd look specifically at your input (keystroke?) manager, and what fsm it communicates to to trigger the run speed.

Sketch

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Prefab 2d velocity problem
« Reply #2 on: June 08, 2021, 01:05:45 PM »
Thanks for the reply!
Yeah, I don't think it is that. The whole run system is triggered by an FSM attached to the player. It refers to USE OWNER to work. I tried targeting it specifically but with no success. It's a weird issue, right? Up to about 2 minutes ago it was running well. No other FSM's or anything target the player's velocity (except for the basic movement).

wetcircuit

  • Full Member
  • ***
  • Posts: 120
    • View Profile
    • wetcircuit.com
Re: Prefab 2d velocity problem
« Reply #3 on: June 08, 2021, 02:53:52 PM »
 :-\

Maybe something to do with the prefab being labeled as 'player' or tagged…?
(I'd think that would carry over to a prefab)

Is the system your own…? Or based on someone's product…? Maybe check the setup again using the prefab instead of the scene figure...

Sorry. Seems like you've checked everything I can think of...

Sketch

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Prefab 2d velocity problem
« Reply #4 on: June 08, 2021, 04:22:50 PM »
No worries! Thanks for your help!

Yeah, it seems tagged okay. I've gone through every fsm and can't find anything conflicting. It's weird because when I test it is technically working, the fsm goes through the states just fine, the animation changes, even the velocity change highlights green. It just simply isn't taking effect.
If it's a clue, his walking speed has slowed down a little too so it's certainly got something to do with the velocity in general... Other moving objects seem fine.

Sketch

  • Playmaker Newbie
  • *
  • Posts: 7
    • View Profile
Re: Prefab 2d velocity problem
« Reply #5 on: June 09, 2021, 10:39:43 AM »
Found a work around!

So, here's the thing, if you're interested.

Wetcircuit, you were right! My normal movement FSM that sets the character walking speed was interfering with the run FSM. I put in an action during run to disable the movement and then reenable it when finished. Seems to work now.

HOWEVER - - This still makes no sense!  :o

These FSM's have been working in conjunction with each other for weeks before suddenly getting in each other's way. I'm still utterly sure that it has something to do with the object's status as a prefab as that is the ONLY thing that changed...

Anyway, all's well that ends well... for now.

Thanks, Wetcircuit for the help!!

wetcircuit

  • Full Member
  • ***
  • Posts: 120
    • View Profile
    • wetcircuit.com
Re: Prefab 2d velocity problem [SOLVED]
« Reply #6 on: June 10, 2021, 01:00:18 PM »
 8) Glad you got it working… even if still a bit of a mystery…

I've a few assets where I need to delay my FSM...
(adding a Wait action at the beginning, like 0.05 seconds)
...because certain components were not yet active in that first frame, but are ready a few frames later.

No idea if that's the case here