Unity 2018: 2D Object - SpriteMesh - unity3d

Ok, so I have looked around the internet but I cannot find the sprite mesh. I should be able to right click my sprite> 2D Object> SpriteMesh.
Problem is that I don't see the option "SpriteMesh" anywhere.
Here's the deal. I created a bunch of 2D pieces for a character: head, body, two arms, two legs, two hands, and two feet. I imported the sprite as a PNG file and changed SpriteMode to multiple. I used the Sprite Editor to slice the char into pieces automatically. There's also nothing inside of the sprite editor that allows me to rig bones either.
Now I need to Rig the toon with bones and skin. However, I cannot find a way to do this. Watching a few tutorials, the guy adds a SpriteMesh to each of the parts. However, when I try to do this, the option just doesn't exist. I see SpriteMask but no SpriteMesh.
I'm using Unity 2018.2.18f1.
I have zero experience in animations like this. Normally I create a player/enemy without legs/arms. So they just float and I use the animation tab to change size/shape to insinuate movement. However, I'd like to take this next step and make the game look better.
How can I rig my toon? What steps do I need to follow?
All help is appreciated!

I guess you want to use the new 2D Features from Unity, if you want to rig your 2D Character.
I'm using Unity 2018.2.18f1.
You need to use Unity 2018.3 or later to use these tools.
I suggest you to use Unity Hub to download multiples versions and Beta versions.
There is a really nice video from Brackeys about this subject also.
When you have the 2018.3 or later version installed, open your project and go to the Window/Package Manager window, you need to install these packages :
I don't think you need the 2D Pixel Perfect but it's always nice to have.

Related

Where are Unity's .h Libraries?

I am messing with Unity's cameras for a school project, my plan was to change the way that coordinates are projected onto the projection plane to a projection onto a sphere using sphere coordinates. But, getting to the actual math behind the cameras has been a bit of a pain.
My first method involved messing with render textures but, theoretically, that won't work because the camera has already rendered a texture which I am modifying.
Next I tried to get into the code for the base camera, maybe make a copy of the camera to modify without messing the original, but then I ran into this, the code that sets all of the camera's parameters for the editor, I saw the reference to a few .h files.
Where can I access these files? I found files with the same names but not related to Unity. They were also different from each-other, making me think that the file above isn't referring to some sort of industry standard, but it might be.
Unity is generally considered to be made up of two parts; the managed front end, and the unmanaged back end. The front end code (written in C#) can be studied on GitHub here. The unmanaged code (written in C++) is proprietary and isn't freely available.
Unity is fairly modifiable, but there are a number of rules you have to follow.
A camera workaround might be to work with the Scriptable Render Pipeline (e.g. URP). But I'm not sure this actually addresses what you're trying to achieve.

How to import cloth simulation from Blender to Unity

The only way that I found to import the cloth animation from Blender to Unity for mobile is by exporting each frame as a separate mesh and then replacing it at runtime to create the animation. (if anyone knows other solution please tell me).
The problems is that the "meshToChange = otherMesh" way has a big hit on performance on mobile. I'm curious to see if there is a better way to change the mesh at runtime.
Thank you :)
There are a few ways to do this
1.The best way would be this:
Get the keyframes for the baked simulation with a .mdd addon for blender.
Import the Blender project in Unity.
Add the prefab in a scene.
Select you object and go to the Skinned Mesh Renderer component and expand the BlendShapes. There you will find all your data.
After that you will need a script to cycle through the BlendShapes. Here is a simple script that will do the job.
For better information check out this video.
Thanks to #derHugo for helping me with this one.
I am not going to focus on the next ones but I will put some references here for anyone interested.
2.Using Alembic files.
If I am correct this is the way the Unity team did it for the short film ADAM.
Check out this video.
To note that this will not work for mobile.
3.Cycling and changing the mesh every frame.
This technique is very similar to a 2D animation.
All you have to do is export a sequence of fbx's for the animation and then cycle through them. script
Be aware that you will get a huge performance hit from this.
With a cloth simulation with around 7k tris changing the mesh every few frames I was getting around 30fps with nothing else in the scene on an IPhone 6.

Tango Predefined Objects

I'm somewhat familiar with tango and unity. I have worked through the examples and can get them to work correctly. I have seen some people doing an AR type example where they have their custom objects in an area to interact with or another example would be directions where you follow a line to a destination.
The one thing I cannot figure out is how to precisely place a 3d object into a scene. How are people getting that data to place it within unity in the correct location? I ha e an area set up and the AR demo seems promising but I'm not placing objects with the click of a finger. What I am looking to do is when they walk by my 3d object will already be there and they can interact with it. Any ideas? I feel like I've been searching everywhere with little luck to an answer to this question.
In my project, I have a specific space the user will always be in - so I place things in the (single room) scene when I compile.
I Create an ADF using the provided apps, and then my app has a mode where it does the 3D Reconstruction and saves off the mesh.
I then load the Mesh into my Unity Scene (I have to rotate it by 180° in the Y axis because of how I am saving the .obj files)
You now have a guide letting you place objects exactly where you want them, and a nice environment to build up your scene.
I disable the mesh before I build. When tango localises, your unity stuff matches up with the tango world space.
If you want to place objects programatically, you can place them in scripts using Instantiate
I also sometimes have my app place markers with a touch, like in the examples, and record the positions to a file, which I then use to place objects specifically... But having a good mesh loaded into your scene is really the nicest way i've found.

How can I make a cube hollow on the inside?

In general I wanted to make it in unity3d but I saw that in tutorials, they made it in blender.
This is what I did in unity:
I want to make this high cube hollow on the inside, and make a small door so that I will be able to walk inside the cube. Later on, I want to somehow add stairs but the problem now is how to make it hollow on the inside.
I saw in some places the suggestion to use blender so I tried this tutorial in blender:
Blender
But got stuck there after I checked the Add Mesh Extra Objects and clicked on Save User Settings. I tried then to click on the bottom on Add > Mesh but then I don't have Extra Objects. I have Extras objects like in the tutorial video.
Anyone my main goal is to make the high cube hollow on the inside with a small door on the bottom so I will be able to walk inside.
From what I know Unity3D has no 3DModelling by default (maybe there is something for that in store), so you need to use Blender or some other program (for example Maya). There is https://blender.stackexchange.com/ where you can ask same question (since it is not really unity3d related)
Maybe this will be helpful : https://blender.stackexchange.com/questions/5849/how-do-i-create-a-solid-object-cube
Overall what you could do, but it is not the est way - you can build a everything out of boxes yourself in Unity3D
Try use to boolean modifier. Take a look this tutorial:
Blender 2.6 Tutorial 26 - Boolean Modifier

Spritesheet creator/importer for unity3d

I am currently developing a 2d game for android using Unity3d , but i am wondering if is there any free sprite sheet creator software that is compatible with unity3d without the extra code to be written , i've tried texture packer with there plugin for unity and it work great but this software is paid and i can not afford it right now ,
i also tried Sprite Sheet Packer but when i import the sprite sheet into unity and trim the sprites in the editor the animation does not work properly due to the fact that unity did not know the pivot point and the exact information of the sprite inside the created sprite sheet,
Does anyone know some useful free software that i can use or some unity plugin that can serve this problem ?
I personally always used TexturePacker (then when I moved to Unity, NGUI does the work for me), so this is a recommendation from a friend:
http://renderhjs.net/shoebox/
A quick test showed that it made a PNG and accompanying XML file with the image data inside. Seems pretty simple.
This question still actual in 2017. So this is my approach:
1) Get xml file with coordinates from your editor. I use DarkFunction sprite editor for fast and smart creation of coordinates. It's free and pretty clever to do lots of jobs automatically.
2) Install this asset from asset store, it's free.
3) Tweak the TextureAtlasSlicer.cs file from the installed asset to correspond to your xml format. You have to do this only once.
That's it.