playMaker

Author Topic: Play animation if object move [Solved]  (Read 6212 times)

Bqlqzs

  • Junior Playmaker
  • **
  • Posts: 52
Play animation if object move [Solved]
« on: September 02, 2013, 05:34:06 AM »
Hello

Can I play animation if the object move?

I want animate my character, but the same way, i need lot of difference,
because ok I set if W key down play forward animation...

But if W key down and more A key down play forward with strafe.. and ect..
It is long and difficult..

So can I play animation if the gameobject is move ? not for keys

Anybody know the simpliest way?
« Last Edit: September 03, 2013, 02:39:05 PM by Bqlqzs »

ranfunk

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Play animation if object move
« Reply #1 on: September 02, 2013, 02:39:30 PM »
https://hutonggames.fogbugz.com/default.asp?W181
don't know is this the right thing

Bqlqzs

  • Junior Playmaker
  • **
  • Posts: 52
Re: Play animation if object move
« Reply #2 on: September 03, 2013, 10:29:34 AM »
Thx but not this...

I want play animation, when the gameobject is moving .

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2511
  • Mender of the past
    • Cleverous
Re: Play animation if object move
« Reply #3 on: September 03, 2013, 11:17:36 AM »
I may not fully understand what you're asking but it is going to be complex regardless, I believe.

It could be simpler if you used Get Axis and setup WASD, then for your animation triggering also use Get Axis. Or, using Get Axis enter/exit states where animations are played based on the axis value.
Products by Cleverous
|| Vault Core : Database
|| Vault Inventory : Multiplayer Inventory
|| Vault Attributes : Character Stats
|| That Hurt! : Dmg Floaties
|| Quinn : 3D

Splankton

  • Sr. Member
  • ****
  • Posts: 268
Re: Play animation if object move
« Reply #4 on: September 03, 2013, 11:39:57 AM »
Thx but not this...

I want play animation, when the gameobject is moving .

I'm after something similar, except I just want to add a count value inside a trigger when the player object moves.  A good way to do it in scripting, is to check the rigidbody for movement, but I cant find it in the action browser.  So there must be another way.

Bqlqzs

  • Junior Playmaker
  • **
  • Posts: 52
Re: Play animation if object move
« Reply #5 on: September 03, 2013, 02:38:14 PM »
Thx but not this...

I want play animation, when the gameobject is moving .

I'm after something similar, except I just want to add a count value inside a trigger when the player object moves.  A good way to do it in scripting, is to check the rigidbody for movement, but I cant find it in the action browser.  So there must be another way.


Ok thank you

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 15500
  • Official Playmaker Support
Re: Play animation if object move [Solved]
« Reply #6 on: September 11, 2013, 03:45:04 AM »
Hi,

 you can check fro rigidbody movement by checking its speed. You can use the action "Get Velocity" and have an float compare to check if it's below a certain threshold.

EDIT: actually, use the action "isSleeping", it's a lot better and a built in feature of Unity.

http://docs.unity3d.com/Documentation/Components/RigidbodySleeping.html

bye,

 Jean
« Last Edit: September 11, 2013, 03:47:19 AM by jeanfabre »

Bqlqzs

  • Junior Playmaker
  • **
  • Posts: 52
Re: Play animation if object move [Solved]
« Reply #7 on: September 11, 2013, 11:14:00 AM »
Hi,

 you can check fro rigidbody movement by checking its speed. You can use the action "Get Velocity" and have an float compare to check if it's below a certain threshold.

EDIT: actually, use the action "isSleeping", it's a lot better and a built in feature of Unity.

http://docs.unity3d.com/Documentation/Components/RigidbodySleeping.html

bye,

 Jean

Yes it is better thank you