게임개발/게임 클라이언트 프로그래밍
벡터 연산의 이해
pudding81
2024. 1. 25. 19:02
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class App : MonoBehaviour
{
[SerializeField] private Transform a; //멤버변수
[SerializeField] private Transform b;
private void Start()
{
//두 벡터의 뺄셈 연산
//연산 결과 : 방향 벡터 (새로운)
Vector3 c = b.position - a.position; //벡터의 방향과 길이
DrawArrow.ForDebug(a.position, c, 10, Color.red);
}
}