I am trying to get the position on the camera in my scene, and I am using a serializable field to get the transform.
I check on start to see if the value is null and I can see in the logs that the value is always null.
I am not sure what I am missing here? I am trying to follow the documentation for referencing an object from unity.
Any help is appreciated, Thanks!
Original Post on Discord
by user 313149111853645827
Is the camera that you reference part of an GlbObject / exported scene?
yes, its the orbit camera from the sandbox scene

by user 313149111853645827
Can you console.log(this) in start ?
I think its because of the name
Can you try renaming your field “transform” to something else?
I think you hit a special case where this specific field is ignored since we never want to export the Unity transform reference that every component has
by user 313149111853645827
Should I use gameobject instead?
by user 313149111853645827
for testing just name it “myObject” or something
Yep, that was it! Thank you so much, this felt like something I could have been stuck on for years.
by user 313149111853645827