【发布时间】:2022-10-14 03:10:51
【问题描述】:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class UnitMove : MonoBehaviour
{
// Update is called once per frame
void Update()
{
if (Input.GetMouseButtonDown(0))
{
Vector3 MousePos = Input.mousePosition;
GetComponent<Transform>().position = (MousePos);
}
}
}
上面是我的代码,每次我构建和运行游戏时,精灵都不会到达我点击鼠标的位置,而是消失。
【问题讨论】:
-
请澄清您的具体问题或提供其他详细信息以准确突出您的需求。正如它目前所写的那样,很难准确地说出你在问什么。
标签: unity3d