回到 Animator深入系列总目录

一开始会理所当然的觉得,匹配是这样的:

但结果却是这样的(右边的Cube是匹配目标):

感觉这个接口应该是专门为攀爬之类的动画准备的,属于被动匹配位置,移动整个对象去匹配

所以像游戏中的斜面双脚的IK匹配,就和这个接口没关系了:

OK,下面附上测试代码:

using UnityEngine;

public class MatchTargetExample : MonoBehaviour
{
public Animator animator;
public GameObject testTarget; [ContextMenu("Start Match")]
void StartMatch()
{
animator.MatchTarget(testTarget.transform.position, testTarget.transform.rotation, AvatarTarget.LeftHand, new MatchTargetWeightMask(Vector3.one, 1f), 0f);
} [ContextMenu("Interrupt Match Target")]
void InterruptMatchTarget()
{
animator.InterruptMatchTarget();
}
}

MatchTargetExample

使用方式:

1.TargetMatching只能工作在base layer

2.InterruptMatchTarget中的completeMatch设为True的话,会立即结束插值自动跳到目标匹配位置。

3.MatchTargetWeightMask是和原有动画之间的权重,如果为1就是完全控制。

4.isMatchingTarget字段确定当前是否在匹配状态

5.startNormalizedTime和targetNormalizedTime是相对于当前动画的匹配开始,结束时间。

Unity-Animator深入系列---目标匹配Target Matching的更多相关文章

  1. Makefile:(实验)多个目标匹配时会采用最完整匹配的目标

    结论源自实验测试,如果有疏漏希望指出 当Makefile中存在多个匹配的目标时,Makefile会采用哪个匹配的目标呢? 测试的Makefile如下: .PHONY: all clean quick_ ...

  2. web.xml文件报错:The processing instruction target matching "[xX][mM][lL]" is not allowed.

    昨晚把我的项目上传到了gitlab,然后今天在公司从gitlab下载下来, 发现web.xml报错.

  3. 关于解决 The processing instruction target matching "[xX][mM][lL]" is not allowed

    在处理和保存XML文件时,出现The processing instruction target matching "[xX][mM][lL]" is not allowed 错误 ...

  4. The processing instruction target matching "[xX][mM][lL]" is not allowed.

    现象: ERROR   : The processing instruction target matching "[xX][mM][lL]" is not allowed.  异 ...

  5. 机器学习进阶-图像金字塔与轮廓检测-模板匹配(单目标匹配和多目标匹配)1.cv2.matchTemplate(进行模板匹配) 2.cv2.minMaxLoc(找出矩阵最大值和最小值的位置(x,y)) 3.cv2.rectangle(在图像上画矩形)

    1. cv2.matchTemplate(src, template, method)  # 用于进行模板匹配 参数说明: src目标图像, template模板,method使用什么指标做模板的匹配 ...

  6. 【转】Unity Animator卡顿研究

    Unity Animator卡顿研究 发表于2017-07-26  点赞3 评论3 分享 分享到 2.3k浏览 想免费获取内部独家PPT资料库?观看行业大牛直播?点击加入腾讯游戏学院游戏程序行业精英群 ...

  7. 【转】unity Animator 怎么判断一个动画播放结束

    关于unity Animator 怎么判断一个动画播放结束这里有几种方法.希望对大家有帮助.还有其他办法的可以分享一下 第一种方法:在动画结束帧后面加个动画事件,调用下含这个变量的函数接口不是可以了? ...

  8. 完美匹配(matching)

    完美匹配(matching) 题目描述 给定nn个点,mm条边的无向图G=(V,E)G=(V,E),求出它的完美匹配数量对106+3106+3取模的值. 一个完美匹配可以用一个排列ϕ:V→Vϕ:V→V ...

  9. Makefile:1: *** 多个目标匹配。 停止。

    以下是我自己写的Makefile 文件: .SUFFIXES:.c .o CC = gcc SRCS = stat.c OBJS = $(SRCS:.c=.o) EXEC = test start:$ ...

随机推荐

  1. Orchard学习系列-----如何运行的

    感慨:当接触到微软这套程序时,代码实在是太好了,好的几乎都读不懂.很久之前就对这个套开源程序特别感兴趣,但读不明白也让人郁闷. 背景(Orchard官网): 可组装系统的CMS系统,OrChard在运 ...

  2. Lintcode: Interval Minimum Number

    Given an integer array (index from 0 to n-1, where n is the size of this array), and an query list. ...

  3. HTML调用servlet(一)

    1.页面的数据表单 在使用Servlet处理用户请求之前,先准备一个页面,该页面用来提供数据表单.数据表单就是HTML中的<form>...</form>部分,当用户单击Sub ...

  4. eclipse 改变字体大小

  5. 2-sat(石头、剪刀、布)hdu4115

    Eliminate the Conflict Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/O ...

  6. codeforces 520 Pangram

    http://codeforces.com/problemset/problem/520/A A. Pangram time limit per test 2 seconds memory limit ...

  7. Eclipse开发C++遇到的Binary not found等问题

    但是一些人可能在编写实际程序的时候,主要是执行程序的时候,会遇到如下两条错误信息,而无法进行开发. Launch failed.Bianry not found A program file was ...

  8. python在window下的Nginx部署

    Python版本3.21 安装nginx下载windows上的nginx最新版本,http://www.nginx.org/en/download.html.解压后即可.运行nginx.exe后本地打 ...

  9. c++之路进阶——bzoj3343(教主的魔法)

    F.A.Qs Home Discuss ProblemSet Status Ranklist Contest ModifyUser  gryz2016 Logout 捐赠本站 Notice:由于本OJ ...

  10. paper 5:支持向量机系列二: Support Vector —— 介绍支持向量机目标函数的 dual 优化推导,并得出“支持向量”的概念。

    paper 4中介绍了支持向量机,结果说到 Maximum Margin Classifier ,到最后都没有说“支持向量”到底是什么东西.不妨回忆一下上次最后一张图: 可以看到两个支撑着中间的 ga ...