setting transforms fails if the first transform set to false
Mimi
ok so, I made this graph in 3 different ways. each version has the exact same bug.
I made a universal transform setter for gameobjects, like teleportto in triggers, but, this lets you chose if you want to copy the position, rotation and/or scale of the reference object.
in all 3 ways I tried to make this, if whatever the first option is is set to false, it fails the other two, such as, in my examples, if position is set to false, rotation and scale fail.
When I swapped it so rotation was first in the block, if rotation is false it fails, but, as long as rotation was on, it works no matter what other two are on or off
UDONSDK-2020.01.14.10.47
VRCSDK3-2020.01.14.10.40
.data_start
.export GameObjectTransform
.export TransformReference
.export SetPosition
.export SetRotation
.export SetScale
message_0: %SystemObject, null
String_0: %SystemString, null
instance_0: %VRCUdonUdonBehaviour, this
eventName_0: %SystemString, null
instance_1: %VRCUdonUdonBehaviour, this
eventName_1: %SystemString, null
instance_2: %VRCUdonUdonBehaviour, this
eventName_2: %SystemString, null
Boolean_0: %SystemBoolean, null
instance_3: %UnityEngineTransform, this
value_0: %UnityEngineVector3, null
instance_5: %UnityEngineTransform, this
Boolean_1: %SystemBoolean, null
instance_7: %UnityEngineTransform, this
value_1: %UnityEngineQuaternion, null
instance_8: %UnityEngineTransform, this
Boolean_2: %SystemBoolean, null
instance_9: %UnityEngineTransform, this
value_2: %UnityEngineVector3, null
instance_4: %UnityEngineGameObject, this
instance_A: %UnityEngineTransform, this
instance_6: %UnityEngineGameObject, this
GameObjectTransform: %UnityEngineGameObject, this
TransformReference: %UnityEngineGameObject, this
SetPosition: %SystemBoolean, null
SetRotation: %SystemBoolean, null
SetScale: %SystemBoolean, null
.data_end
.code_start
.export _interact
_interact:
PUSH, String_0
PUSH, message_0
COPY
PUSH, message_0
EXTERN, "UnityEngineDebug.__Log__SystemObject__SystemVoid"
PUSH, instance_0
PUSH, eventName_0
EXTERN, "VRCUdonCommonInterfacesIUdonEventReceiver.__SendCustomEvent__SystemString__SystemVoid"
PUSH, instance_1
PUSH, eventName_1
EXTERN, "VRCUdonCommonInterfacesIUdonEventReceiver.__SendCustomEvent__SystemString__SystemVoid"
PUSH, instance_2
PUSH, eventName_2
EXTERN, "VRCUdonCommonInterfacesIUdonEventReceiver.__SendCustomEvent__SystemString__SystemVoid"
JUMP, 0xFFFFFF
.export SetPosition
SetPosition:
PUSH, SetPosition
PUSH, Boolean_0
COPY
PUSH, Boolean_0
JUMP_IF_FALSE, 0x0000B3
PUSH, GameObjectTransform
PUSH, instance_4
COPY
PUSH, instance_4
PUSH, instance_3
EXTERN, "UnityEngineGameObject.__get_transform__UnityEngineTransform"
PUSH, TransformReference
PUSH, instance_6
COPY
PUSH, instance_6
PUSH, instance_5
EXTERN, "UnityEngineGameObject.__get_transform__UnityEngineTransform"
PUSH, instance_5
PUSH, value_0
EXTERN, "UnityEngineTransform.__get_position__UnityEngineVector3"
PUSH, instance_3
PUSH, value_0
EXTERN, "UnityEngineTransform.__set_position__UnityEngineVector3__SystemVoid"
JUMP, 0x0000B3
JUMP, 0xFFFFFF
.export SetRotation
SetRotation:
PUSH, SetRotation
PUSH, Boolean_1
COPY
PUSH, Boolean_1
JUMP_IF_FALSE, 0x000124
PUSH, GameObjectTransform
PUSH, instance_4
COPY
PUSH, instance_4
PUSH, instance_7
EXTERN, "UnityEngineGameObject.__get_transform__UnityEngineTransform"
PUSH, TransformReference
PUSH, instance_6
COPY
PUSH, instance_6
PUSH, instance_8
EXTERN, "UnityEngineGameObject.__get_transform__UnityEngineTransform"
PUSH, instance_5
PUSH, value_1
EXTERN, "UnityEngineTransform.__get_rotation__UnityEngineQuaternion"
PUSH, instance_3
PUSH, value_1
EXTERN, "UnityEngineTransform.__set_rotation__UnityEngineQuaternion__SystemVoid"
JUMP, 0x000124
JUMP, 0xFFFFFF
.export SetScale
SetScale:
PUSH, SetScale
PUSH, Boolean_2
COPY
PUSH, Boolean_2
JUMP_IF_FALSE, 0x000195
PUSH, GameObjectTransform
PUSH, instance_4
COPY
PUSH, instance_4
PUSH, instance_9
EXTERN, "UnityEngineGameObject.__get_transform__UnityEngineTransform"
PUSH, TransformReference
PUSH, instance_6
COPY
PUSH, instance_6
PUSH, instance_A
EXTERN, "UnityEngineGameObject.__get_transform__UnityEngineTransform"
PUSH, instance_5
PUSH, value_2
EXTERN, "UnityEngineTransform.__get_localScale__UnityEngineVector3"
PUSH, instance_3
PUSH, value_2
EXTERN, "UnityEngineTransform.__set_localScale__UnityEngineVector3__SystemVoid"
JUMP, 0x000195
JUMP, 0xFFFFFF
.code_end
Log In
Phasedragon
This can be fixed by making sure that you don't pull variables from branches that may or may not execute. In this case, the gameobject get transform node happens in the first branch, and then all the other branches pull from that. If it is separated so each branch has it's own gameobject get transform node, then it works just fine.
Mimi
Phasedragon: I fixed it doing this. I'm not sure if this is an udon issue or not
Observer.
Mimi: Based on the flow and what Phasedragon just explained it looks to be an Udon issue as one would expect the three flow lines from the original get transform node to be duplicated for each branch allowing each to work independently.
I understand Udon trying to optimise the calls like that but in this case it should probably not have tried to take three separate flows and turned it into one.
Observer.
Phasedragon: I really hope its not an intended workflow to have the user physically duplicate the nodes when the flow lines indicate that the code/nodes should be duplicated already.