How to make pseudo 3D or 2.5D effect? - unity3d

After using Unity for over a year now for creating 3D games I'd like to do my first pseudo 3D or 2.5D game (or whatever it's called). What I mean is games like Clash of Clans or Boom Beach where objects are really 2D images rendered to give 3D feeling. Because I don't even know the correct word for that type of games it's really hard to get started. What I can think of is giving Camera rotation of (45, -45, 0) so that it looks down at the ground from the upper right corner and then creating empty gameObjects with Sprite Renderers and setting their rotation to (22.5, -45, 0) so that they face the camera. I don't know if that's how it's really done so could somebody give me a link to some neat tutorial or something because I'm stuck.

The keyword you are looking for is isometric projection.
You can use Unity to create that effect with 3D graphics. You need to set the camera rotation to (45, -45, 0) and set the Camera Projection to Orthographic.
If you want to only use 2D graphics then the graphics are made in such a way that they are drawn in an angle that it looks like you are looking at them in 45 degrees.
If you search for isometric unity then you should find a ton of tutorials for Unity.

Related

Projecting procedural attack telegraph decal in Unity

I'm creating an isometric 3d brawler in Unity. I'm trying to draw a telegraphing "attack area" effect on the ground (Meshes, not Unity terrain), from an arbitrary polygon (including curved lines.), based on Vector3 points.
I figure I need to use the Unity decal system, but I'm not sure how to generate the area texture procedurally, especially since it needs to match points in 3d space. Here are a few examples of the effect I'm looking for.
Thanks for taking your time to read this :)

Clamp camera within bounds of a Polygon Collider?

Hi I am making a 2d platformer game and right now I am working on the camera. while I succeeded in clamping the camera inside a rectangular shape, my game involves slopes, so I want my camera to be able to clamp inside a curved shaped too. Can anyone help me find an idea for the code?
Cinemachine gives you a flexible 2D camera controller, with the option to confine it inside a PolygonCollider2D. This section contains explanation for that and other cool things.

2D Sprites in Isometric 3D Unity Project

The project works under a isometric orthographic camera, in a 3d space using 2d sprites.
What we are using are billboarding sprites into 3D colliders to archieve the 3d feeling.
The problem is that we don't really believe the way we are doing it it's the most optimal. We are also having problems introducing high areas, because we need to reply the sprite form in isometric perspective as colliders.
Because we are using 3D world, the tilemaps tools conflicts with the other vertical sprites.
We can not use a entire 2d floor billboarding sprite because that suposes to have a huge vertical sprite in front of the camera, so we can not display the others.
We are just researching for a solution before to change to a 2D world.
If you plan on sticking with isometric in 3D, get rid of the tilemaps entirely. They are just going to give you a headache and make your game lag itself to death. If you want to convert to entirely 2D isometric, you can stick with them as they would work fine. Now, a few comparisons between the 2D and 3D approaches, and how best to approach them. This is a jumbled list of drawbacks/advantages to each type, so it's more of a ramble after this point than an answer, but I couldn't be more specific without knowing more about your project's overall requirements and specifications.
Unity recently added Isometric Tilemapping as a dedicated feature. So, if you choose to fake it with 2D, your life will be a lot easier.
Controls are a lot easier in 3D, as the physics won't ever have to be
faked.
3D allows foreground objects to automatically cover up background
objects without having to add an arbitrary system to achieve the same
effect.
2D is fundamentally faster than 3D, and if you're aiming for mobile,
that's going to be very important to your project's success.
3D allows you to rotate your camera if you design it right. (Check out Don't Starve Together for an example of this design).

Finding pixel on sprite in Unity

In Unity3d we have RaycastHit.textureCoord but it doesn't exist anymore in 2D. I was searching about this problem, a lot but I didn't find anything useful.
So I want to know the solution for this problem and I'm wondering why method like textureCoord in 3D doesn't exist in 2D actually in RaycastHit2D.
also I want to access to the pixel when mouse cursor on it.
It works in 3D because RaycastHit.textureCoord requires a mesh collider. In the 2D case it is way simplee because you can calculate the position yourself as you know the sprite hit, the cursor position and size of the sprite.

How can I make custom 2D polygon in Unity with collision detection?

I am learning Unity and I want to make a little game where the user controls a tank and she can shot with it. My plan is when the missile hit the terrain, it makes a hole in that, like in the old school Worms. My first idea was to make the terrain as a textured polygon and when a collision happens, change the polygon structure. Is it possible to implement this?
You can do a little trick with a 3D mesh. If you are using orthogonal camera the Z axis won't be visible and you will be able to add mesh collider. If you still want to do custom things with that mesh like changing shape there are assets on the store:
http://u3d.as/content/chris-west/mega-fiers/1Qa
Or
When a missle hits terrain change you terrain texture pixels alpha channel to 0
http://docs.unity3d.com/ScriptReference/Texture2D.SetPixels.html
Then use raycasts to check if alpha channel != 0 for moving.