Use name to change position?

Is it possible to make this code simpler?

Im finding the object by name then having to use that variable in the long part. Is it possible to just use the name directly? No tags, just name.

Var test = gameObject.Find(“cube1”);

test.transform.position.x = 5;

You should make a reference to that gameobject as a variable - then you can use the variable. You can call it what you like. What you are doing doesn’t look like a best practices way of achieving something - but I don’t know what you are trying to do or where this code executes :slight_smile: