-
카테고리
-
세부 분야
게임 프로그래밍
-
해결 여부
미해결
평행이동과 좌표계, 부모 자식 설정 강좌를 보면서
18.06.14 22:26 작성 조회수 153
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);
}
했는데 아무런 움직임이 없어요 ㅠㅠ
답변을 작성해보세요.
답변 0