So I tried doing this script to make one objects position the same as the player’s at all times, but I keep getting the error “‘transform’ is not a member of ‘Object’”
#pragma strict
var PlayerOBJ;
function Start () {
PlayerOBJ = GameObject.FindWithTag("Player");
}
function Update () {
transform.position(PlayerOBJ.transform.position.x,PlayerOBJ.transform.position.y, PlayerOBJ.transform.position.z);
}
var PlayerOBJ : GameObject;
function Start () {
PlayerOBJ = GameObject.FindWithTag("Player");
}
function Update () {
transform.position = PlayerOBJ.transform.position;
}
Edit: Didn’t realize Oniony already answered. But yeah when you don’t specify that PlayerOBJ is of type GameObject, it will automatically be determined as being of type Object which obviously doesn’t have a transform. You also don’t have to manually do each axis, just saying one transform position is equal to another transform position works as a shorthand.