Uploaded November 2026 | Updated November 2026, 6 days ago
⚔️ Two sword hits each carry 40 damage and 80 durability. Compare two separate plain class instances with == and you get false. In this C# tutorial, see what record, struct, and readonly each add to DamageEvent. Then use a with expression to make a copy, set its durability to 50, and pass it to a typed listener.
🎮 Wishlist Recursive Nightmare, my indie psychological horror game, on Steam
store.steampowered.com/app/4987450/Recursive_Nightmare/?utm_source=youtube&utm_medium=description&utm_campaign=csharp_record_struct
00:00 Same hit data, false result
00:19 Plain classes and reference equality
00:37 What record, struct, and readonly add
01:05 Compare two record structs
01:42 Change one field with a with expression
02:01 Boxing and typed events
02:19 Unity compiler support
02:32 Recursive Nightmare on Steam
🧠 When to use it
A readonly record struct makes a small hit payload easy to compare and copy. The typed path shown in the video creates no new heap allocations per hit. Boxing the same payload into object creates a heap allocation.
📌 Compiler support
Record structs require C# 10 or later. Unity projects using the default C# 9 compiler can use a plain readonly struct with explicit value equality.
🎓 Free complete Unity courses
youtu.be/yEjwUSQb0YA
▶️ Related video
How to Keep Debug Logs Out of Your Final Build
youtu.be/CaZwqB0s2Ec
🛠️ Helpful Unity assets (affiliate links)
Top new assets
assetstore.unity.com/top-assets/top-new?clickref=1101lBmqghh5&utm_source=partnerize&utm_medium=affiliate&utm_campaign=unity_affiliate
Top paid assets
assetstore.unity.com/top-assets/top-paid?clickref=1101lBmqgLt2&utm_source=partnerize&utm_medium=affiliate&utm_campaign=unity_affiliate
Unity Pro
unity.com/products/unity-pro?clickref=1101lBmqqm6L&utm_source=partnerize&utm_medium=affiliate&utm_campaign=unity_affiliate
🔔 Subscribe for more C# and Unity tutorials
youtube.com/channel/UCgXs2PTiL19Rv1qOn1SI7XQ?sub_confirmation=1
🌐 Find me on X, Instagram, LinkedIn, Discord, and itch.io
https://x.com/ArianKhatiban
instagram.com/arian.khatiban
linkedin.com/in/arian-khatiban-49b30017a
discord.gg/8hpGqBgXmz
cloudtears.itch.io
#CSharp #RecordStruct #GameDev #Unity #GameDevBox
⚔️ Two sword hits each carry 40 damage and 80 durability. Compare two separate plain class instances with == and you get false. In this C# tutorial, see what record, struct, and readonly each add to DamageEvent. Then use a with expression to make a copy, set its durability to 50, and pass it to a typed listener.
🎮 Wishlist Recursive Nightmare, my indie psychological horror game, on Steam
store.steampowered.com/app/4987450/Recursive_Nightmare/?utm_source=youtube&utm_medium=description&utm_campaign=csharp_record_struct
00:00 Same hit data, false result
00:19 Plain classes and reference equality
00:37 What record, struct, and readonly add
01:05 Compare two record structs
01:42 Change one field with a with expression
02:01 Boxing and typed events
02:19 Unity compiler support
02:32 Recursive Nightmare on Steam
🧠 When to use it
A readonly record struct makes a small hit payload easy to compare and copy. The typed path shown in the video creates no new heap allocations per hit. Boxing the same payload into object creates a heap allocation.
📌 Compiler support
Record structs require C# 10 or later. Unity projects using the default C# 9 compiler can use a plain readonly struct with explicit value equality.
🎓 Free complete Unity courses
youtu.be/yEjwUSQb0YA
▶️ Related video
How to Keep Debug Logs Out of Your Final Build
youtu.be/CaZwqB0s2Ec
🛠️ Helpful Unity assets (affiliate links)
Top new assets
assetstore.unity.com/top-assets/top-new?clickref=1101lBmqghh5&utm_source=partnerize&utm_medium=affiliate&utm_campaign=unity_affiliate
Top paid assets
assetstore.unity.com/top-assets/top-paid?clickref=1101lBmqgLt2&utm_source=partnerize&utm_medium=affiliate&utm_campaign=unity_affiliate
Unity Pro
unity.com/products/unity-pro?clickref=1101lBmqqm6L&utm_source=partnerize&utm_medium=affiliate&utm_campaign=unity_affiliate
🔔 Subscribe for more C# and Unity tutorials
youtube.com/channel/UCgXs2PTiL19Rv1qOn1SI7XQ?sub_confirmation=1
🌐 Find me on X, Instagram, LinkedIn, Discord, and itch.io
https://x.com/ArianKhatiban
instagram.com/arian.khatiban
linkedin.com/in/arian-khatiban-49b30017a
discord.gg/8hpGqBgXmz
cloudtears.itch.io
#CSharp #RecordStruct #GameDev #Unity #GameDevBox

![Instantiating Gameobjects at random screen position - [Unity Tutorial]
Instantiating Gameobjects at random screen position, this tutorial will show you how to create random prefab objects at various position in your game at random.
Comment on any training you want 👊
🟩 Download the script here:
https://drive.google.com/file/d/1rbzqJa0wmTlpjIHJ6145rggBa-GeIWdo/view?usp=sharing
🟩 Subscribe to GolomOder :
https://www.youtube.com/channel/UCgXs2PTiL19Rv1qOn1SI7XQ?sub_confirmation=1
🟨 Music: https://www.purple-planet.com
🟨 Assets : www.kenney.nl
#learnunity #unitytutorial #Instantiate
Remember to like and comment 🙌
If you have any questions post them in the comments and Ill do my best to answer them. Instantiating Gameobjects at random screen position - [Unity Tutorial]](https://i.ytimg.com/vi/TEungGKKSVo/mqdefault.jpg)


![Introduction Free Assets 2D Unity [Part 1]
Some Unity assets 2D
You can Download for free from the following links :
Pixel Art Platformer - Village Props : https://assetstore.unity.com/packages/2d/environments/pixel-art-platformer-village-props-166114
Free Platform Game Assets : https://assetstore.unity.com/packages/2d/environments/free-platform-game-assets-85838
Sunny Land : https://assetstore.unity.com/packages/2d/characters/sunny-land-103349
Comment on any training you want 👊
🟩 Subscribe to GolomOder :
https://www.youtube.com/channel/UCgXs2PTiL19Rv1qOn1SI7XQ?sub_confirmation=1
🟨 Music: https://www.purple-planet.com
#learnunity #unitytutorial #Assets
Remember to like and comment 🙌
If you have any questions post them in the comments and Ill do my best to answer them. Introduction Free Assets 2D Unity [Part 1]](https://i.ytimg.com/vi/U47gs0oJyag/mqdefault.jpg)





