728x90
멈춤 없이 타겟까지 이동(애니메이션 효과 x)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class UnitychanController : MonoBehaviour
{
public Transform target;
private bool isMoveStart = false;
void Start()
{
}
void Update()
{
if(this.isMoveStart)
{
this.transform.Translate(this.transform.forward * 1f * Time.deltaTime,Space.World);
}
}
public void MoveStart()
{
this.isMoveStart = true;
this.transform.LookAt(target);
}
}

'KDT > 유니티 기초' 카테고리의 다른 글
23/08/06 유니티 기초 복습(CatEscape, Bamsongi) (0) | 2023.08.06 |
---|---|
23/08/05 유니티 기초 복습(Roulette, CarSwipe) (0) | 2023.08.05 |
23/08/04 유니티짱 직선으로 움직이기 (0) | 2023.08.04 |
23/08/03 애니메이션 방향 전환 및 점프 연습 (0) | 2023.08.03 |
23/08/02 키보드로 인풋 받아 이동하기 (0) | 2023.08.03 |