Uploaded September 2023 | Updated September 2026, 2 weeks ago
If you use Invoke("NameAsString") to delay a method call in Unity try using nameOf(..) expression, instead of passing a string argument directly๐โจ๏ธ
โก๏ธInvoke(nameof(MakeItRain), 3); โฌ ๏ธ
This way you can easily change the name of a method and avoid bugs connected to typing it by hand ๐ชฒ๐
#UnityTips #unity2d #unity3d #gamedev #gamedevelopment #indiedev #IndieGameDev #shorts
If you use Invoke("NameAsString") to delay a method call in Unity try using nameOf(..) expression, instead of passing a string argument directly๐โจ๏ธ
โก๏ธInvoke(nameof(MakeItRain), 3); โฌ ๏ธ
This way you can easily change the name of a method and avoid bugs connected to typing it by hand ๐ชฒ๐
#UnityTips #unity2d #unity3d #gamedev #gamedevelopment #indiedev #IndieGameDev #shorts










