Hey guys,
I’m creating a game where I want a car to pass by over and over again. I know how to let the object move but I don’t know how to reset it so it starts again at its starting point.
I’m trying it like this but nothing happens, tried to find the right answer but there’s none.
I’m a noob in C#, do you also have tips to help me getting better at C#
public class Rewspawn : MonoBehaviour
{
void Start()
{
}
void OnTriggerEnter(Collider other)
{
Vector3 orginalPosition = gameObject.transform.position;
if(other.gameObject.tag == "End")
{
gameObject.transform.position = orginalPosition;
}
}
}