#That means `serializedObject` is null
1 messages · Page 1 of 1 (latest)
So it is exactly as I have it?
to the t
well here
void ConnectionHandles()
{
using var serializedObject = new SerializedObject(structure);
SerializedProperty connectionsProperty = serializedObject.FindProperty("connections");
foreach (SerializedProperty c in connectionsProperty)
{
SerializedProperty positionProperty = c.FindPropertyRelative("position");
positionProperty.vector3Value = TransformHandles(positionProperty.vector3Value, default);
}
serializedObject.ApplyModifiedProperties();
}
Is structure null...?
Oh ffs this is a Editor?
and target is never null and target is of type structure
yeah this is editor
that why I came to editor channel
ok so then what
Just remove the using var serializedObject = new SerializedObject(structure); from the start
OHHHHH i get it!!!!!
That might be screwing it up because serializedObject is already defined
Odd that it wouldn't throw an error...
What errors?
NullReferenceException: Object reference not set to an instance of an object
On this line: SerializedProperty connectionsProperty = serializedObject.FindProperty("connections");
Please paste the full script here https://gdl.space/
Along with the structure class in another
there you go
First class is structure, second is editor, third is the connection point I want to undo
Gotta share the links. It isn't a live share thing
translate?
Ya gotta add the [Serializable] attribute to the StructureConnection class so Unity can actually serialize it