unity set position

unity set position

t carew

7 лет назад

21,372 Просмотров

How to set the position in unity 3d

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class setposition : MonoBehaviour {
Vector3 StartPoint;

// Use this for initialization
void Start () {
StartPoint = transform.position;
}
void OnTriggerEnter(Collider hit)
{
if (hit.gameObject.CompareTag("respawnZone"))
{
transform.position = StartPoint;
}
}




}
Ссылки и html тэги не поддерживаются


Комментарии:

Valkor lalle
Valkor lalle - 10.09.2023 20:41

thanc yuo for this turolial, it helpes veri mutch

Ответить
GameDevUnity
GameDevUnity - 20.04.2022 22:24

Very cool! But is there any a way to do this as a button instead of collision and Set an another gameobject in this position?

Ответить
Carlis R
Carlis R - 27.08.2021 21:48

It always returns to the 0,0,0 point, not to the point where my object was originally, why?

Ответить
Holly Williams
Holly Williams - 27.07.2021 09:48

I have an assignment due in a couple days and this saved my life

Ответить
JmmiP 20
JmmiP 20 - 27.05.2021 10:00

I know this is an old video, but when I set my Vector3 equal to transform.position, it returns NaN in Debug.Log. I have it contained within the start method, so idk why I can't set it.

Ответить
Live Art
Live Art - 18.12.2020 10:23

thanks , helped me a lot

Ответить
armaan
armaan - 09.10.2020 14:33

Thanks

Ответить
xFSN_Archer
xFSN_Archer - 09.10.2018 16:29

the audio has like a 10 second headstart of the video lol

Ответить
Vyasa R. Ituarte Correa
Vyasa R. Ituarte Correa - 29.05.2018 22:04

Awesome, thanks.

Ответить
Starnight Studios
Starnight Studios - 15.09.2017 05:38

Awsome, thanks keep it up!

Ответить