playMaker

Author Topic: Set Animator Look At Action Doesn't Work On Arbitrary GameObject  (Read 452 times)

MTG_Derek

  • Playmaker Newbie
  • *
  • Posts: 1
    • View Profile
Set Animator Look At Action Doesn't Work On Arbitrary GameObject
« on: December 12, 2017, 06:25:25 PM »
Hi all! Trying to use the Animator LookAt Action and have noticed odd behavior--essentially, I have a GameObject (with an Animator) and I'd like to have this character look at something. I attach an FSM to the character, set up the state machine, add the action and voila, the character is looking at the target transform as expected.

However, I would prefer to have this FSM be on a different GameObject--so I duplicated the FSM, stuck it on a different object and changed the action's "Game Object" variable from "Use Owner" to "Specify Game Object", where I am using the previously-working GameObject as the reference. Unfortunately, this does not seem to work, even though a quick look at the code shows that it's grabbing the specified GameObject and the animator correctly. If I had to guess, it has something to do with the fact that OnAnimatorIK is not a function that belongs to the calling object in the second case, but I'm not sure what's going on under the hood.

Can anyone shed any light as to this behavior and if there is something I'm missing or some kind of workaround? Thanks!

jeanfabre

  • Administrator
  • Hero Member
  • *****
  • Posts: 13305
  • Official Playmaker Support
    • View Profile
Re: Set Animator Look At Action Doesn't Work On Arbitrary GameObject
« Reply #1 on: December 13, 2017, 11:49:06 PM »
Hi,

 yes indeed it's on the object, like triggers and colliders, future version of PlayMaker will likely lift this constraint.

 Bye,

 Jean