I'm trying to make an adventure with a 2D character and 3D background (as I have access to easy 2D player creation/animation tools and sketchup for making scenes - graphics are not my strong suit!) - is this possible?
I've been trying to create a 2D character as per the 2D demo, and though I have created a character with a controller and animations, I can't get it to move anywhere around the scene (or animate as if it's moving around the screen). I'm guessing it's because the movement is based on something 3D (a capsule collider perhaps?) but even if I have the 3D thing I'm missing, I'm not sure if I can link a 2D animation to it.
Any pointers please?
Unity 5.1.0p1 - Adventure Creator 1.45
So
Comments
Also go through AC 2d game tutorial video, it's not too long.
The only change you'd need to make to make a 2D character work perfectly in 3D would be to swap the circle collider by his feet with a Capsule Collider. But animation and movement should all work regardless. Post a screenshot of your character's full Inspector, and we'll see what can be done.
My navmesh instead of turning opaque (as per your 3d demo) has a wireframe when I drag it onto the meshcollider, then disappears when I drag it onto the mesh filter. I've dragged tinpot on to be my default player, and made a collider floor (as per the demo) but there's no tinpot to be seen.
For 2D characters, you MUST have a sprite child - this is key to getting them to rotate correctly. However, having the Animator component on the base isn't mandatory - if you need the Animator and Sprite Renderer to be on the same object, you can move both of them onto the sprite child object.
Apart from how NavMeshes are created (and the need for Sorting Maps in 2D), the general workflow for working in 2D and 3D is largely the same - many of the topics covered in both demos and tutorials are transferrable.
Where is Tin Pot when the game begins? He should be positioned at the Default PlayerStart marker, and should be visible if you've put down a floor collider.
As for the NavMesh, check that you've assigned it as your Default Navmesh in your Scene Manager, and that you created the "NavMesh" layer when installing AC - it's covered by both tutorials.
I know this thread is 5years old but on the off chance - don't suppose anyone knows how to get a shadow from 2d Brain in a 3d scene. Getting 2d Brian working in a 3D scene worked perfectly - just looking around the web for ways of getting shadow and light to work with him (i.e. cast shadow on and from sprite renderer).
Edit:
1 step in the right direction...
https://docs.unity3d.com/Manual/class-SpriteRenderer.html
The default Material for newly created Sprites is Sprites - Default. Scene lighting does not affect this default Sprite. To have the Sprite react to lighting, assign the Material Default - Diffuse instead. To do this, click the small circle next to the Material field to bring up the object picker window, and select the Default-Diffuse Material.
But you end up with a box-y quadlike shadow and black square behind the Brain 2d art.
Update - it seems the shaders that come with Spine tutorial assets can cast shadows! but not receive shadows - I whish I knew unity a bit better. It feels like I'm a small step away from getting there but...
If the shadows are a result of the Spine assets, I'd say Spine's developers are the best people to ask about how receiving shadows might be done.
update -after further searching I found a link on this forum, from GreenCubeGames
https://forum.unity.com/threads/sprites-bumped-diffuse-shader-and-transparent-cutout-bumped-diffuse-with-shadows.217827/
Which leads to this shader:
https://github.com/anlev/Unity-2D-Sprite-cast-and-receive-shadows
Seems to work perfectly, in case anyone else needs it.