r/Unity3D – Telegram
r/Unity3D
260 subscribers
12.5K photos
15.5K videos
14 files
47.8K links
News about the Unity engine and project showcases from Reddit. Made possible with @reddit2telegram (@r_channels).
Download Telegram
Looking for an in-depth guide for Easy Save 3

I bought Easy Save 3 recently and I am having trouble integrating with my project. I used the Auto Save Function in the quick guide they give, but it isn't working. Anyone know if there are detailed tutorials about it?

https://redd.it/1pwgg3f
@r_Unity3D
Effectively Instantiate and Destroy gameobjects?

So, I am working on a 2d side scroller game like burrito bison. Currently I am having the ground prefab removed and created when player reaches a certain distance, but there is a huge spike in performance and I can see the jittering. Abit more details about it.. Its a pixel art game with resolution 640 x 360 and I have tried with upcapping the FPS, but that didn't worked either.
One solution I can think of is using object pooling technique (which I most likely would) but what I wanted to know is how some games handle destroying/creating new game objects or enemies? Like how is it done in vampire survivor or like platformer games?

If anyone can help me understand this it would be huge help. Thanks

Edit:

https://preview.redd.it/ixr8agpvpn9g1.png?width=439&format=png&auto=webp&s=797c4acf2babbb7a2c76e1d434f0eb014a4ae8cd



https://preview.redd.it/li8yvapypn9g1.png?width=450&format=png&auto=webp&s=f0a8662e977d012c39ed003dd2ef7981e2b18408



https://redd.it/1pwlcao
@r_Unity3D
I'm having an issue where I'm trying to activate 3 duplicates of the same animator but only one of them seams to trigger. Is this an issue with my code or can you not duplicate animator controllers this way?

https://redd.it/1pwiuwm
@r_Unity3D
Sharing the noscripts and code I use to create component based UI with the UI Toolkit in a code first/programmatic approach

Sharing it incase someone else who also prefers to do stuff through code might find it useful. And since I've seen a lot of people mention they dislike working with the UI Toolkit (and personally I find it easy to work with, so maybe someone else might also find it useful)

The noscripts and code: https://github.com/TonWonton/UnityUIToolkit_ComponentBasedCodeFirst
They are licensed with the MIT-0 No Attribution license, which means you can do basically anything with/to it. Don't even have to give credit/attribution or include the license file if you use it in anything.

TLDR of what the noscripts do and how it works is
- On the gameobject theres one "top level" UI noscript that you add whatever UI controllers you want on it
- The UI controllers are then initialized which causes them to create the elements related to them
- The "top level" UI noscript then handles the logic for the overall state and the UI controllers handle the functionality and logic for themselves and it's elements (it can be coded to do whatever you want ofc. but thats atleast what I use it for)

So basically composition where most parts should be modular and reusable (depending on how you use/code it), such as the elements themselves, UI controllers, and also the gameobject and "top level" UI if you make it into a prefab.

Its also almost fully automated. It will automatically create the elements and then remove the elements when the gameobject is destroyed or disabled, as well as register or unregister C# events at the same time by just filling out a few methods with a few lines of code.

With this workflow basically all of the work can be done with the IDE or text editors. I only have to use the UnityEditor to create a gameobject that holds the UIDocument and attach the noscripts I want to use on it.

Its a code first approach so you have to write code for the stuff you create such as writing custom elements and the logic/functionality for them (also all the noscripts are abstract classes so theres nothing you can use out of the box without coding sorry lol). I've written a lot about it and how I use it in the README on the github page, as well as included a lot of examples and other noscripts I find useful. There might ofc. be better approaches to doing UI (tbh I'm not the most experienced in coding and Unity so not sure) but I hope atleast someone might find it useful. If you have any questions or would like to see more or specific examples feel free to ask.

https://redd.it/1pwtdec
@r_Unity3D