인프런 커뮤니티 질문&답변
평행이동과 좌표계, 부모 자식 설정 강좌를 보면서
작성
·
229
0
부모의 좌표를 받아서 해와 달을 스페이스바를 누를때 부모에게로 모이도록 하고싶습니다.
public class move : MonoBehaviour {
public Transform targetTransform;
void Start () {}
void Update () {
if (Input.GetKey(KeyCode.Space))
{
Move();
}
}
void Move()
{
Vector3 direction = targetTransform.position;
transform.Translate(direction * Time.deltaTime);
}
했는데 아무런 움직임이 없어요 ㅠㅠ
답변
답변을 기다리고 있는 질문이에요
첫번째 답변을 남겨보세요!





