Setting game object position on startup? (Beginner)

Hi everyone, I’m new to Unity, and I’m making a very basic car game. I want a flag to reposition itself when I start the game, but I cannot seem to figure it out. I tried this:
using UnityEngine;
using System.Collections;

public class FlagScript : MonoBehaviour {
	
	// Use this for initialization
	void Start () 
	{
		transform.position.Set(1,1,1);	
	}
	
	// Update is called once per frame
	void Update () {
	
	}
}

This seems like it should work to me, but the object that I assign the script to simply refuses to move to the new position! Where am I going wrong? Thanks in advance!

transform.position returns a copy. So essentially you are setting position of a COPY of a variable you are trying to set.

(Might be different in unityscript. Not sure.)

Use:

transform.position = new Vector3(1,1,1);

or (i guess)

transform.position = transform.position.Set(1,1,1);

Brilliant! Thanks, I can’t believe I didn’t think of that. Good call! :slight_smile: Thanks so much!!