MerlinVR / UdonSharp

An experimental compiler for compiling C# to Udon assembly
MIT License
669 stars 88 forks source link

Fixed implements of instantiate #130

Closed ikuko closed 2 years ago

ikuko commented 2 years ago

Fixed a bug in the implementation of Instantiate in U#1.0. However, the Scale value may not be copied correctly. This is also caused by floating point calculation errors since get_localScale returns a calculated value. The solution to this is to stop emulating overloading and call the Unity method directly.

MerlinVR commented 2 years ago

What is this fixing? On the contrary, this looks like it's breaking the mitigation for instantiate position and rotation not being maintained in VRChat?

ikuko commented 2 years ago

@MerlinVR The behavior of Instantiate is different between C# and U#1.0. This is a fix for that. We have prepared the following simple test code, which compares the results of C# and U# (InstantiationShim) behavior. https://gist.github.com/ikuko/49b8275946e9404cac4551b0ee7f36e9 I apologize if this is my mistake.