可以修改最后一帧,把那条线移到最后一帧就好了
可以修改最后一帧,把那条线移到最后一帧就好了
找到纹理贴图和normal贴图
smooth设置为零 因为人物不需要金属质感
模型的三种导入模式:
点击模型找到rig: legacy
button的animation模式制作动画
Rig:
humanoid 人形
Geneic 所有的
type legocy
animatioons 播放动画:
target.TransformDirection(Vector3) 官方解释是局部坐标转化成世界坐标
其实是 把 参数 Vector3 当成了target 中的局部坐标
返回值是 Vector3 在世界坐标中的值
可以把Vector3 当成子节点的坐标来理解
设置IK动画的操作需要在 OnAnimatorID 中执行
-摄像机跟随角色
选中main camera 点击gameobject选择align with view修改相机位置
private Transform player;
private Vecort3 offset;
prieate float smoothing=3;
void Start(){
player=GameObject.FindGameObjectWithTag("player").transform;
offset=transform.position-player.position;
}
void LateUpdate(){
vector3 targetPosition=player.position+player.TransformDirection(offset);
transform.position=Vector3.Lerp(transform.position,targetPosition,Time.deltaTime*smoothing);
transform.LookAt(player.position);
}
添加bool值判断shift键是否按下
在animator controllers中选择bool选项添加判断条件
判断编码
private int isspeedupID=animator.stringtohash("isspeedup");
void update(){
if(input.getkeydoen(keycode.leftshift))
{
anim.setbool(isspeedupid,true);
}
if(input.get(keyup.leftshift))
{
anim.setbool(isspeedupid,false);
}
anim.SetFloat(一个ID,一个值)
anim.SetFloat(一个字符串,一个值)
ID获取方法(可将一个值转化为一个ID)
private int speedID=Animator.StringToHash("speed")
//运用stringtohash来将字符串转化成ID
这样如果输入ID错误将会直接报错
分割动画:
人物角色动画:
脚本控制动画状态机:
trigger-触发器
bool-t or f
int-整数
float-小数
less-小于
greater-大于
equals-等于
状态机(控制状态切换)
entry-进入状态
any state-任何状态
exit-退出状态
橙色标签表示默认状态
连接线为转换条件
has exit time当前一段动画播放完毕时自动进入到下一个动画
conditions-条件
avatar definition-骨骼预设
create from this model-为此对象新建模型
copy from other avatar-复制其他骨骼
root node-根节点
rig-设置动画的导入方式
humanoid-人形动画
generic-所有类型都可以使用
legacy-旧版本动画 不能使用状态机 只能使用animation播放
materials-材质
textures-贴图
UGUI button状态下动画只需要创建一个关键帧就好
normal-普通状态
highlighted-鼠标移上
pressed-鼠标点击
disabled-设置为不能选择