playMaker

Author Topic: building anim graph, "get speed" not working  (Read 4712 times)

mikejkelley

  • Full Member
  • ***
  • Posts: 136
building anim graph, "get speed" not working
« on: September 29, 2013, 03:07:48 AM »
Using Unity 4.2.1.f4 and PM 1.7.3.f1, I'm trying to build an animation graph. I have a "Get Speed" action attached to my player model but it never reports anything other than 0. The player model has a rigid body attached. I desperately need to get this sorted ASAP, any help will be greatly appreciated. Thanks.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: building anim graph, "get speed" not working
« Reply #1 on: September 30, 2013, 01:47:30 AM »
Hi,
 
 you are targeting the wrong object, you need to target the toplevel gameObject "first person controller"

Bye

 Jean

mikejkelley

  • Full Member
  • ***
  • Posts: 136
Re: building anim graph, "get speed" not working
« Reply #2 on: September 30, 2013, 02:53:17 AM »
Thanks I tried, but get speed requires a rigidbody, and when I add a rigidbody to fpc it no longer responds to input and slowly sinks through the ground. 

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: building anim graph, "get speed" not working
« Reply #3 on: September 30, 2013, 04:47:21 AM »
Hi,

 Then the other action to use would be:

http://hutonggames.com/playmakerforum/index.php?topic=1182.0

 and that's not using physics, it works on any objects

 Bye,

 Jean

mikejkelley

  • Full Member
  • ***
  • Posts: 136
Re: building anim graph, "get speed" not working
« Reply #4 on: October 03, 2013, 04:42:04 PM »
Thanks, but this has NDE as well. I'm using PM in conjunction w/ FPS Control, are there any known issues there?

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: building anim graph, "get speed" not working
« Reply #5 on: October 04, 2013, 01:23:21 AM »
Hi,

 what is NDE?

Bye,

 Jean

mikejkelley

  • Full Member
  • ***
  • Posts: 136
Re: building anim graph, "get speed" not working
« Reply #6 on: October 05, 2013, 07:59:09 PM »
Hi, sry, nde = no discernible effect, ie it's still reporting 0.

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: building anim graph, "get speed" not working
« Reply #7 on: October 07, 2013, 03:14:33 AM »
Hi,

 Very odd. Can you try on a different object?

bye,

 Jean

mikejkelley

  • Full Member
  • ***
  • Posts: 136
Re: building anim graph, "get speed" not working [SOLVED]
« Reply #8 on: October 11, 2013, 05:51:01 PM »
yes, actually I made an empty game obj the child and was able to get its speed, so that will currently suffice as a workaround. Thanks.

mikejkelley

  • Full Member
  • ***
  • Posts: 136
Re: building anim graph, "get speed" not working
« Reply #9 on: November 09, 2013, 05:20:05 PM »
So, I'm rebuilding my project nearly from scratch and encountering similar weirdness all over again.

Get Game Object Speed weirdness was cured, for the most part, by baking Root Transform Positions into all of my animations (for some reason though I was unable to do this in Mecanim, it was all greyed out, so I had to do it in the project folder).

Get Speed, which requires a rigidbody, simply increases ad infinitum.

But, and here's the embarrassing part, I never needed Speed in the first place. I assumed I needed Speed bcs that's what the variable is (super poorly) named in Unity's Mecanim Tutorial. The other var is Direction. But rly in the example Speed is longitudinal movement (which has a direction too) and Direction is latitudinal movement (which, obviously has a speed value as well).

What is actually needed from Playmaker is Get Axis Horizontal and Get Axis Vertical. And then send them in through the Mecanim action packs (which Playmaker needs to do a better job of advertising IMHO!). :)

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: building anim graph, "get speed" not working
« Reply #10 on: November 11, 2013, 01:18:11 AM »
Hi,

 Have you studied the samples provided with this playmaker bridge pack from the wiki? in there you see how the "speed" property of the anim graph is controlled.

The "problem" with this technic is that it's one of many ways to get it done and very much something to deal with on a per character, per mecanim, per project need... so not real hardwritten rules as to how to control this "speed" property unfortunatly. So indeed, like you did, it's better to understand what exactly the mecanim graph is expecting in the first place ( yes, "speed" is misleading in this case, but I tried to por the Unity samples as they are truly made, so I did not change anything on naming, protocoles and features, so that you can really study a true Unity example made with PlayMaker).

bye,

 Jean