When is it better to use Resources.Load in Unity? - unity3d

Hello everyone I recently learned how to use Resources.Load, but I have a question, when should I use it?
For example, I have a button that has 2 different sprites. What is the best way to do, load these two sprites in advance in the editor and turn one on and off the other? Or at the Start, load it Resources.Load<Sprite> and replace the sprite in the Source Image?
Please explain when and how best to use Resources.Load. Examples will be useful

Resources.Load is useful for loading prefabs common to many scenes. And for editor scripts.
Nevertheless, the devs will be deprecating Resources.Load at one point, but backed off from it, because there are good reasons to keep it around until/if they replace it with something better.

If you have some Resource not use it at all time. you can use Resources.Load
when you use before. it's about your memory.

Related

Is it worth keeping the built-in render pipeline?

I've been having trouble creating a simple shader for overlaying a png onto a background color as a material. I've done a lot of searching, and almost all solutions seem to be using a shadergraph. I tried it, and it works.. but I would have to convert the entire project to URP, and I don't know if it's worth it. Alternatavely I have managed to write a shader that does this, but it seems like a lot more work/time.
Do you usually just use URP and convert all other materials? Or is there a better way to do stuff like this with the built-in?
Thanks so much for your help.
URP is the future of Unity and they try to implement it as a default. Because of that I strongly suggest at least learn how to use it. And I'm doing all my project with URP with no problem.

My unrealengine lags when placing actors for world generation

I want to make world generation sort of like minecraft with destructable environment, but even one layer of blocks makes my game lag a lot, so i would like to know if there is anyway i can reduce or prevent the lag. Or any alternative ways to creating world gen that doesn't lag that much.
My level blueprint that makes the world gen looks like this:
(I couldn't fit it in one screenshot but the print string is the same in both pictures)
The cube actor which is spawning currently has no code but since i want a destrucable environment it will have code latter.
I have attepted to use voxel instead but it says im missing a .dll file, which im not sure what to do about. Where in the computer should i put that file?
The image here is in danish, but it says that the program could not be started, because VCRUNTIME140_1.dll is missing on the computer. Try to reinstall the program to fix the problem.
Thanks for the help
The game lags after you spawn or only while spawning the objects? consider using code instead of blueprints, usually you have better performances.
Use hierarchical instanced static meshes instead actors!
More details: YouTube

Easiest way to create an animated 3D cartoon

I was wondering, what is the easiest way to create an animated 3D cartoon. I want to create a character which moves and talk. I am not familiar with an easy way to do it, I used Blender and Unity but I was wondering if there is an easy way to do it? as I believe that not everyone doing 3D cartons have to dig deep in coding, they certainly use a software/GUI or something to create it.
I am not sure what easy is defined for peole but someway might be easy for me , it may be hard for you. I think it is based on experience in the past.
If you want to create a custom 3d animated model, you need to model it first. Or you can find a 3d model which is similar to your model, so you can edit it. But you are going to use a 3d modeling programs like; Blender, 3ds Max, even SketchUp might work.
One easy way. Which requires less work
You can check Adobe Fuse. Which lets you select predefined parts and lets you create a 3d humanoid model. You can tweak them a bit. After completing you can export it to Mixamo where you can rig your model (also you can select premade models here). They have alot of animations to go. After selecting your animations you can import it to Unity.
Animation techniques
For most of them, you will need rigs. When you rigged a model, you can create animations with those rigs.
This is my one of the old works from university.(Ignore the music please :D) Before i make the animations, I've recorded myself on the exact angle with model, (Front and side 2 videos) and used my video as refence while animating. To conclude i used key frames. And Blender made the rest (making transaction between keyframes). This is one of the techniques.
--EDIT--
This might give you more information about the video referencing.
More budgeted projects mostly use mo-cap. Here is one example for facial animation.
There are also cheaper infrared cameras like Kinect which allows you to do mo-cap. But results are not that promising. You can find more than few assets in the Unity Store. But i suggest you to use at least 2 cameras if you choose this way.
There might be more ways to create 3d model animation. I am not an animator. But those are that i know.
Hope this helps! Cheers!

what element i need to use to build game like this

i am building a game which is similar to the Plain Jane Flash Game for the iPad. I have decided to use cocos2d for the same, while exploring the cocos2d there are lots of option i am having. i am confuse in which elements/controls would be best for this type of game Please guide me or share any link/tutorial on cocos2d which have similar user interface.
I mean shall i use CCMenu/CCmenuItem or there is another control which is more suitable...
shall i use Sprite or simple image would be sufficent as i do not need to move anything in it.
Thanks
Although your question was not very clear, I assume your referring to the functionality of dragging and dropping different clothing items onto the game avatars. A custom CCSprite object would be much more appropriate for doing that.
However, there is not an easy answer for what you are asking. Creating a game like "Plane Jane" will involve many problems that I'm sure have not crossed your mind. I recommend you complete a few Cocos2d-iPhone tutorials before you go any further. Once you do that, you will have a much better understanding of the functionality you will need to create your game.
Here is a nice tutorial for starters:
http://www.cocos2d-iphone.org/archives/582

cocos2d and box2d .. creating map and worlds

So my question is really about creating different levels in my game. I am using cocos2d and box2d and right now I have a lot of code that actually constructs my world and I can't do pane or stuff like that coz honestly i don't know how..
So any tips and pointers for beginner to create world with static object and then I can add my own sprite to that world and move around with box2d?
Start running through the tutorials for Cocos2D. All of them. Modify them to see changes your interested in. I can think of a number of ways you might be able to construct your levels but it wouldn't necessarily make sense if you are not familiar with the Cocos2D classes and terminology. Try posting your question on the Cocos2D forums as well. Possibly someone in the Cocos2D community has already done this.