Search Unity

Triggering animations on props when held not working

Discussion in 'VR' started by EmilyAnimator, Mar 18, 2020.

  1. EmilyAnimator

    EmilyAnimator

    Joined:
    Mar 13, 2020
    Posts:
    3
    Hi, I hope someone can help me, I am using the XR tookit and Playmaker.

    I have made a little crab that the player can pick up. I would like him to squirm his legs, as crabs do, when he is being held. But for some reason, he plays his squirm animation when you touch him, but stops when you actually grab and hold him.

    I am using Playmaker to trigger his animations. I put a FSM on each of he hand controls that goes like this:

    State: Crab NOT held
    --Animator Play action that tells the crab's animator to play the idle animation clip
    --Trigger event, for when the crab collides with the hand. It checks for a tag that I put on the crab. (I have also tried this with the trigger set to "On Trigger Enter" and "On Trigger Stay" and had the same issue)

    this sends it to the second state

    State: Crab HELD
    --Animator Play action that tells the crab's animator to play the squirming animation
    --Trigger event for when the crab leaves the hand (on trigger exit) again, using the crab's tag.

    this sends it back to the "Crab NOT held" state.

    I don't understand what the XR Offset Grabbable script really does under the hood to know if there would be a conflict. I have experience in python but not in C# so I am pretty Playmaker dependent. Any ideas?

    Thanks!
     
  2. MShotts

    MShotts

    Joined:
    Aug 8, 2019
    Posts:
    11
    Hi Emily,
    I'm another Playmaker dependent but have primarily worked with the Oculus Integration and the Oculus Touch Playmaker Toolkit. I was trying to do something similar with the Oculus custom hands and things only started working once I added an action that also checked if the user had the grip button depressed. Trigger Stay on its own was insufficient for reasons that are beyond me.