How to merge two background sprites in Unity so that there won't be a line between the merging sides? - merge

Hello guys, I am making a 2D platformer game in which I will be adding background sprites. And while doing so, I will be joining many(let's say two) sprites to make it look like one long background. However, when I join two background sprites, a line is visible at the joining point, making it evident that I merged two sprites there. How do I make it look like it is a single image? How do I remove the line between them? Please help me fix this. Any help would be very much appreciated.

I struggled with this problem too, i solved it indirectly by creating a third joiner sprite that is a child of the first sprite and placed at its end (covering the line). As the backgrounds move the third sprite always covers the joining line. The joining sprite can be a a drawing of anything eg clouds, wall, etc

Related

Why can I see the inside of a room as soon as I cross it, in Unity?

I am currently working on a 3d game in Unity, and I am working on the level design using ProBuilder. I basically created a huge cube which I "flipped normal", and a second one way smaller
which, as the other one, I flipped normal, but as soon as I crossed it while turning backward I could weirdly see through the small cube, which makes it feel unfinished. How could I fix this issue?
Normally in 3d games triangles can only be seen from one side. Usually this is not a problem because walls have some thickness. Since you clearly have paper thin walls made of only one layer of triangles this is exactly the result you should expect.
In short add the other side to your walls. The simples way is to duplicate the existing triangles and flipping them. Walls will still be paper thin of course. Later you should probably make them thicker.

Collision issue when player moves from one object to another

In unity 5 I am having an issue with certain collisions. I made a basic maze-like game where the player controls a cube across platforms (made from other cubes). In certain areas, two or more of the platforms touch so the player can get to different areas of the level. The problem with my collision happens at these intersections. The player will seem to get stuck for no reason and they would have to back up and get a running start in order to get to the other platform. I went through everything and made sure they are lined up perfectly in the unity editor but nothing seems to fix this.
Any advice would be greatly appreciated .
EDIT: all of my objects are using box colliders
A common (and good) practice is to use a Circle collider on the bottom of your character object in conjunction with a Box collider.
For Example:
While this will likely fix your issue, the source of the problem is probably using many small tiled cubes each with their own colliders. A large amount of tiled objects with colliders most likely cause performance and collision issues.

Unity3D: How to make effect that cut avatar into pieces

I'm new to Unity3D, after several official tutorials I got some basic understanding about Unity3D. Now I would like to have fun with making my game.
I would like to have a sword cut an avatar into pieces. Like the game "Fruit Ninja", cutting fruit into pieces.
The specific effect I want: the cutting should be according to sword-cutting-angle, in other words, the breaking-pieces effect should vary according to every cut, that feels real.
My thought: since Avatar is made by Mesh Filter, if I cut the avatar by waist, into two pieces(upper body, lower body), I should use code to make two Mesh Filter to hold the two pieces.
I'm not expecting very detailed code, that could be a lot. I'm just wondering if I could get a clue about how to make this effect. Because I think "cutting avatar into piece" should be a general effect in game.
Thank you in advance :)
It's not easy as you may think...
Here you can get one approach to the solution:
it clones the object, finds a plane based on user variables, and flattens all the points on the other side of the plane onto it, then repeats this with the clone and the other side of the plane.
Other approach could come from using shaders, search for "cut away view shader".
I hope I have given you the start kick

Breaking up a sprite in cocos2d

I'm making a 2D plane fighting game for the iPhone in cocos2d. I'm trying to make it so when you shoot an enemy plane, it breaks into a couple of separated pieces that will fall out of sight. What is generally the best practice for breaking one sprite up into many? should I create new images for each separate piece, or treat the initial image like a sprite sheet, and make a new sprite from segments?
Please look at this tutorial
It makes a grid of points then moves the internal (not-edge) ones around randomly a bit so it's not all perfect triangles. Then each update it moves/rotates the triangles separately--then draws them all at once.
You treat the whole thing as a sprite, so can run any of the usual actions on it. This example uses CCMoveBy to move the whole group down off the bottom.

How to handle a game world that wraps, using cocos2d on the iPhone

I have a game world that's much bigger than the view port, the main character stays in the center of the view port at all times and the background layer is moved around to give the impression of the character moving. I want to make it so that the game world wraps, meaning if the the character keeps traveling either left or right they will eventually end up back at the starting position. There will be moving entities in the game world so the biggest problem I foresee is that if you go to the far right of the map you should be able to see any of the moving entities that are within the first small section of the far left of the map.
I've thought a bit about this and any solution I've come up with seems far too complicated. Like creating two identical game worlds side by side and moving them around accordingly. I live in hope that there is an elegant solution to this. Any expertise you can share would be greatly appreciated.
I'm using cocos2d on the iPhone just in case that makes any difference.
An example might be to have an x,y offset for your camera, and a multidimensional array of sprite objects.
As the player moves, the offset value changes, e.g., xMove = -1.4 and yMove = +2.6.
Then you would iterate and change the positions of all the tiles by that amount.
Next, you would identify the sprites that are too far away from the center of the screen (0,0) and re-position them to the opposite side, so they will always be visible.
This would all be done on the same scheduled 'tick' so no graphical artifacts occur.
I'm pretty surprised no one has made a wrappable tile map yet for cocos2d.
I can't give cocos2d specific advice, but I would say the most common way to do this is to create one game world, draw (parts of it) multiple times and make sure that your logic for things like collisions and AI checks for wrap-around where appropriate.
So if your player character is close to the corner of the world, you'd draw the world four times with different offsets. This needn't actually draw every single thing in the world four times any more than you would normally need to draw the entire world when only a small part of it is on-screen.