playMaker

Author Topic: "Get Game Object Speed" not progressing[SOLVED]  (Read 1947 times)

panterra

  • Playmaker Newbie
  • *
  • Posts: 3
"Get Game Object Speed" not progressing[SOLVED]
« on: May 18, 2017, 05:59:55 PM »
I'm trying to get the speed of a Game Object (which is being moved by a Nav Mesh Agent component) and store it in a float variable, "tempMqSpeed." I'm using "Get Game Object Speed," which I downloaded from the Ecosystem. But for some reason, the FSM isn't progressing to the next state, "SetSpeed" (see attached image); it just stays stuck on "SpeedUpdate." Am I missing something?

(By the way: Previously, I was trying to use "Get Speed," and although that would progress to the next state, it didn't get the velocity ... maybe because of the NavMesh thing?)
« Last Edit: May 23, 2017, 02:13:25 AM by jeanfabre »

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: "Get Game Object Speed" not progressing
« Reply #1 on: May 19, 2017, 07:12:38 AM »
Hi,

 This action is running every update by default, so it never tells the state that it's finished and so the state never call FINISH.

 you can't get the speed of a gameobject without a rigibody without at least two frames. So the solution are:

-- run the game object speed action on a dedicated fsm doing just that and use GetFsmFloat to retrieve the speed.

-- leave the action running for two frames or a split of a seconds time to get the speed and then transit to the next state.

 Bye,

 Jean

panterra

  • Playmaker Newbie
  • *
  • Posts: 3
Re: "Get Game Object Speed" not progressing
« Reply #2 on: May 19, 2017, 02:16:08 PM »
Awesome, thanks! Problem solved.