I make a game with unity in 2d mode.
I want FPS mode and a camera such as DOOM game that hand are in from of player view but in 2d game mode.
Make camere child of Player object so it moves and rotates along with player.
But you stil probably want it to be perspective camera and " 3D" game even if you use flat objects with no depth.
Doom was 2D but it was pretending to be 3D
It all depends what you mean by 2D, there are many ways depending on what you want.
Related
First of all, please understand that I am using a translator.
I'm making a first person game and I've split it into two cameras. A camera that renders the main camera and the player's arms. FYI it's a URP and the camera sometimes doesn't render the hand mesh for the player's arm.
I have no idea what the heck is going on.
I've developed an airplane 3D shooter game. In this game, I want to make my plane shot a bomb. When the bomb gets to the enemies it will explode and give damage in the area of explosion.
I have already searched for a tutorial to make this code and the animation of explosion. But I couldn't find it. Please tell me about something that could solve this problem. I'm developing my game using C#.
For the explosion animation, you could use a particle system. There are many pre-made ones in the Asset Store, such as this one: https://www.assetstore.unity3d.com/en/#!/content/42285
For detecting what is affected in the explosion's area of effect, do a SphereCast (https://docs.unity3d.com/ScriptReference/Physics.SphereCast.html) from the point of impact and then do whatever you want with any of the objects touched by the sphere.
In the 2D game I have 2 orthographic cameras and two game objects, one behind another.
Near game objects have transparent sprites so we can see the back game object.
The near game object's depth is 0 and the other one's is -1. I want my first camera to render the near scene and another camera to render the back game object. The first camera follows the character so I want the second camera to follow him slowly and to show nice graphics.
The game object that you only want visible to one camera should be put in it's own layer. Then you can use its camera's culling mask to only see that layer (Or lets say that layer and the background layer).
Then for the camera that should never see the object, uncheck the object's layer.
Here is a video on the subject here from Pluralsite on Youtube.
SO I saw a tutorial online how to make a particle system, and I made it. Only thing is, I want to use it for a 2D Menu. So when I add the particles in front of the canvas, they don't show up in 2D. How do I make particles that will show up on a 2D menu?
You can try positioning your Canvas in World Space, then moving it behind the particle system. This will allow the Canvas to be positioned like all the other objects in your scene, and no longer be constrained to the camera.
Here's a guide from Unity on how to do it.
Im making simple 2D game, I designed the "way" the player going through in the game.
If the player touches the wall the game is over, so I must detect collisions.
At first I created the walls from sprites, but then I realized there is no 2D collider that suit himself to the shape of the sprit(it was to difficult to create the collider manually from a lot of smaller polygon and circle colliders), so I made all the walls that builds the "way" 3D objects(.dae files with z=0.001), and added them the mash collider which suits himself to the 3D object. I changed my player to be 3D as well so the collisions types will match.
It worked, but I'm sure the same game can work by much better performance with the same resources if all the game objects were 2D.
How can it be that there if a collider that suits himself to a 3D object but there is none for 2D?
Maybe I miss something?
At my first attempt I didn't export the sprite correctly so the polygon collider didn't recognized the shape of my sprite.
I export the sprite as JPEG, when I export it as .png it worked like a charm, just added the Polygon Collider and it match to my sprite shape perfectly, thanks!