vrchat-community / UdonSharp

A compiler for compiling C# to Udon assembly
https://udonsharp.docs.vrchat.com
MIT License
470 stars 50 forks source link

OnParticleCollision Udon graph program crashes in 3.4.0-beta.1 #148

Open KyrowoVRC opened 1 year ago

KyrowoVRC commented 1 year ago

Describe the bug in detail: The "OnParticleCollision" event doesn't work in the 3.4.0-beta.1 anymore.

Provide steps/code to reproduce the bug:

  1. Create a new Udon project.
  2. Create a new cube and add a Udon Graph to it.
  3. Add OnParticleCollision event and connect anything after it. example: OnParticleCollision -> Debug.log
  4. Create a particle system with collision enabled and send collision message. It should face the cube
  5. Go into playmode, test or uploaded build.
  6. Unity throws an error and udon behaviour script crashes, when the particle system collides with the box collider of the cube.

Expected behavior: Udon Behaviour script should not crash. This only happens in the latest VRChat SDK - Worlds v3.4.0-beta.1 . v3.3.0 works fine.

Additional Information: Error log:

Destroying GameObjects immediately is not permitted during physics trigger/contact, animation event callbacks or OnValidate. You must use Destroy instead. UnityEngine.Object:DestroyImmediate (UnityEngine.Object) VRC.Udon.Security.UnityEngineObjectSecurityBlacklist:IdentifyDontDestroyOnLoadHandle () VRC.Udon.Security.UnityEngineObjectSecurityBlacklist:IsBlacklistedGameObject (UnityEngine.GameObject) VRC.Udon.Security.UnityEngineObjectSecurityBlacklist:FilterBlacklisted (object&) VRC.Udon.Wrapper.Modules.ExternUnityEngineDebug:LogSystemObject__SystemVoid (VRC.Udon.Common.Interfaces.IUdonHeap,System.Span1<uint>) VRC.Udon.VM.UdonVM:Interpret () VRC.Udon.UdonBehaviour:RunProgram (uint) (at Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1029) VRC.Udon.UdonBehaviour:RunEvent<UnityEngine.GameObject> (string,System.ValueTuple2<string, UnityEngine.GameObject>) (at Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:1273) VRC.Udon.UdonBehaviour:OnParticleCollision (UnityEngine.GameObject) (at Packages/com.vrchat.worlds/Runtime/Udon/UdonBehaviour.cs:765)