【发布时间】:2020-05-21 19:23:58
【问题描述】:
我需要编写一个 C# 脚本来制作改变角色的动画。情况:用户(VR用户)靠近并进入一个npc的碰撞区域,该npc处于坐着的动画循环中。一旦用户进入 npc 的碰撞区域,npc 将动画更改为“坐立”,并从那里一系列动画到达另一个地方。如何编辑此脚本以确保在触发碰撞区域后发生动画更改。这是我从 youtube turorial 找到的代码,一旦他进入触发区域,它就会显示用户名。如果需要更多信息,请告诉我。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class sittingtrigger : MonoBehaviour
{
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
void onTriggerEnter(Collider other)
{ Debug.Log(other.name); }
}
}
【问题讨论】:
标签: c# visual-studio unity3d animation