- Home /
Get in car - Target Match
Hi everyone! this time I'm trying to my sexy character get in the car. using the script from "Target Match" from "Mecanim Example Scenes" I could do that the character go to the target and open the door. But when I put a blend tree, with the locomotion, the target doesn't work. just that part, everything else, works fine.
any idea? or other way to put the character in one specific position an rotation? the part of the code with problem, and images.
void Update () {
if (animator)
{
AnimatorStateInfo state = animator.GetCurrentAnimatorStateInfo(0);
// ENTER CAR ***
if (!inCar & Input.GetButton("Fire1"))
{
animator.SetBool("Jump", true);
}
if (state.IsName("Base Layer.enter_Car"))
{
animator.SetBool("Jump", false);
animator.MatchTarget(LeftHand.position, LeftHand.rotation, AvatarTarget.LeftHand, new MatchTargetWeightMask(new Vector3(1, 1, 1), 0), animator.GetFloat("MatchStart"), animator.GetFloat("MatchEnd"));
hasJumped = true;
//enterCar();
}
}
}
Its Works! :D
And with Blend tree no more :(
Answer by Pherseo · Jun 27, 2014 at 08:07 PM
no one helped me, but its okay u__u after all, I change the way I was doing it. this is the result! :D
Would love to know how you did that. I've been working on a wrestling game and trying to get two players to touch each other... No one seems to answer questions anymore. T.T
Your answer
Follow this Question
Related Questions
Animator.MatchTarget 0 Answers
Mecanim Target Matching isn't working!! 0 Answers
Moving to points 3 Answers
How do I queue up targets in a TD? 1 Answer
Setting camera target after I instantiate the gameobject? 2 Answers