VRCObjectSync Respawn does not work
available in future release
Erallie
I tried this both with udon graph and udon sharp. Both times, when calling the Respawn function, the udon script throws an error and halts. It says that the reference is not set to an instance of an object, even though every time, I check, and there
is
an object with a VRCObjectSync attached to it that Respawn()
is called from. And Respawn()
is
called from the VRCObjectSync, and not the GameObject.This is the error I get from udon graph:
[UdonBehaviour] An exception occurred during Udon execution, this UdonBehaviour will be halted.
VRC.Udon.VM.UdonVMException: The VM encountered an error!
Exception Message:
An exception occurred during EXTERN to 'VRCSDK3ComponentsVRCObjectSync.__Respawn__SystemVoid'.
Parameter Addresses: 0x00000000
Object reference not set to an instance of an object
----------------------
Program Counter was at: 28
----------------------
Stack Dump:
----------------------
Heap Dump:
0x00000000: Microphone (VRC.SDK3.Components.VRCObjectSync)
0x00000001: Microphone (VRC.SDK3.Components.VRCObjectSync)
0x00000002: VRCSDK3ComponentsVRCObjectSync.__Respawn__SystemVoid
----------------------
Inner Exception:
---> VRC.Udon.VM.UdonVMException: An exception occurred during EXTERN to 'VRCSDK3ComponentsVRCObjectSync.__Respawn__SystemVoid'.
Parameter Addresses: 0x00000000
---> System.NullReferenceException: Object reference not set to an instance of an object
at VRC.SDK3.ClientSim.ClientSimObjectSyncHelper.RespawnObject (VRC.SDK3.Components.VRCObjectSync sync) [0x00000] in .\Packages\com.vrchat.worlds\Integrations\ClientSim\Runtime\Helpers\ClientSimObjectSyncHelper.cs:18
at VRC.SDK3.Components.VRCObjectSync.Respawn () [0x00009] in <6ff4ff48394b436282bb70dc0ff277c2>:0
at VRC.Udon.Wrapper.Modules.ExternVRCSDK3ComponentsVRCObjectSync.__Respawn__SystemVoid (VRC.Udon.Common.Interfaces.IUdonHeap heap, System.Span`1[T] parameterAddresses) [0x0001d] in <b001fa9908f1453c979dae8b67f4c4f7>:0
at VRC.Udon.VM.UdonVM.Interpret () [0x00273] in <62e4a0d35446446b8fa1f8e5755bcfaa>:0
--- End of inner exception stack trace ---
at VRC.Udon.VM.UdonVM.Interpret () [0x0033c] in <62e4a0d35446446b8fa1f8e5755bcfaa>:0
--- End of inner exception stack trace ---
at VRC.Udon.VM.UdonVM.Interpret () [0x00436] in <62e4a0d35446446b8fa1f8e5755bcfaa>:0
at VRC.Udon.UdonBehaviour.RunProgram (System.UInt32 entryPoint) [0x00063] in .\Packages\com.vrchat.worlds\Runtime\Udon\UdonBehaviour.cs:1098
UnityEngine.Debug:LogError (object,UnityEngine.Object)
VRC.Core.Logger:LogError (string,string,UnityEngine.Object)
VRC.Udon.UdonBehaviour:RunProgram (uint) (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1112)
VRC.Udon.UdonBehaviour:RunEvent (string) (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1306)
VRC.Udon.UdonBehaviour:ManagedUpdate () (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:551)
VRC.Udon.UdonManager:Update () (at ./Packages/com.vrchat.worlds/Runtime/Udon/UdonManager.cs:354)
Log In
This post was marked as
available in future release
_
_tau_
We originally believed the 2 issues described here are the same root cause, but there was a misunderstanding. In reality, there are 2 distinct bugs:
- Objects will respawn in the last received location, instead of at their origin point.
- In ClientSim, calling "Respawn" can trigger a null reference exception.
For the former, we have a fix that will ship in the next major release.
For the latter, this will happen when calling "Respawn" on a gameobject that has never been enabled. Erallie Is it possible that you are doing just that? I'm not sure this is really so much a bug as much as it is undefined behaviour. An object that was never enabled doesn't have an origin position of first activation.
StormRel
Merged in a post:
VRCObjectSync.Respawn no longer properly works
CompuGeniusCode
In a recent update, VRCObjectSync.Respawn now makes objects twitch a bit, but they do not respawn to the original position. This happens across several worlds.
zSkull162
I noticed this happening in my worlds too. Even though it uses an SDK version a few releases old because it hasn't been updated in a while, my objects with a VRCObjectSync are now respawning where they last were, and not where they started.
CompuGeniusCode
zSkull162 Yup, exactly right. It seems to be a client issue, not an SDK issue (hence why I put it here and not under SDK Bugs).
CRiMSOM13
Are you...
SenkyDragon
Seems like this is very easy to reproduce.
- Create and join an instance of https://vrchat.com/home/world/wrld_dbf9a443-28c9-4fff-8267-2af3f19dd75e/info
- Join the instance with a second client
- Enter the portal, get teleported to the main world, then cross the hologram bridge. Immediately after the bridge, find the tower of glowsticks on the left side.
- Pick up and move a glowstick using player one.
- Pick up and move the same glowstick using player two. Then click the corresponding respawn button on the tower.
Expected: Glowstick should return to the tower at its original spawn position
Actual: Glowstick moves back to the position where it was dropped by player one
Again, this bug is NEW to the current round of open beta (currently 1746). NOTE: In my testing, player one was on live and player two was on open beta. I did not test both players being on beta.
vidvisionify
This behavior is also happening in my world (Vid's Cosy Bedroom). If you're alone, throwing around objects and respawning them with the broom (or throwing them into the fire) seems to be fine. When another player joins and the broom reset is used, the objects sometimes(?) go back to where the last player left it, but usually not where they belong. Rotation seems to be reset to 0 as well.
SenkyDragon
This is not the same issue. The new bug is unique to the current beta, and does not seem to throw an udon error.
StormRel
Merged in a post:
[1744] VRCObjectSync.Respawn is broken
SenkyDragon
In the beta, VRCObjectSync.Respawn seems to either not work at all, or sends the object back to the wrong location. The issue only seems to happen if the object has been moved by someone else first.
- Join a world
- Pick up an object and move it somewhere else
- Join the world in a second game instance
- Attempt to respawn the object from the second instance
This issue does not exist on live.
Fax
marked this post as
tracked
Fax
marked this post as
needs more information
Hi Erallie! Can you please share your Udon graph or a screenshot of your Udon graph?
Erallie
Fax This is my udon graph. I was initially calling this in UdonSharp, and created this graph to try to work around not being able to call it in udon sharp. If you need me to share my udon sharp script, I can do that too.
Load More
→