Forum rules - please read before posting.

Navmesh in 2.5D with 2D camera

I'm sorry, I just can not figure out how to build a navmesh on a 2D background in a 2.5D game to use a 2D camera.
I know it's not the right forum to ask for it but would you have some quick suggestion?
I've also tried to refer to this AC tutorial but it would seem to not fit my background I think because my walking area is very large.
If I get up and I rotate the camera to frame the navmesh segment  the background is deformed due to perspective
imageimage

If I leave the camera at y = 0 and I I rotate the plane I get a correct framing but of course the perspective of the walking character is altered and in any case it does not seem a good idea

image

I've tried to build everything like from 2.5D tutorials and of course it works properly. Then I added a 2D camera but when I turn it on  the background disappears because it is connected to the 2.5D camera.
I have seen the Scrolling background tutorial in 2.5D games but it does not solve this problem.
Is there a chance to solve it?

Comments

  • edited September 2017
    The 2.5D tutorial fudges things a little because the backgrounds are photos, so exact camera data/measurements weren't available.

    If the background is pre-rendered, then I'd say the way to get a "perfect" match would be to use the "Mesh Collider" pathfinding method, using a NavMesh built in the same 3D scene/software that the pre-rendered scene was made in.

    The camera values, and NavMesh transform, would then need to be transferred from the 3D software into Unity, so that the two match up.
  • edited September 2017
    Unfortunately my backgrounds are pictures or drawings of which I do not know any parameters so work will be particularly hard, I know.
    I tried to build a Mesh Collider using 3DS Max and its Perspective Match function. I see that I can get something matching.
    I still have to figure out how to match 3DS Max Mesh Collider and Camera units with those of Unity which are different.
    But this is my problem.
    What I wonder, however: though I can build a good mesh collider what if I have to lift the camera because the background view is a bit from the top and I have to give the character's perspective? The background would not be deformed because it is not attached to the camera as in the 2.5D?

  • edited September 2017
    I have experienced that I can create a plane and assign to it a new material with the image of my background. Then I can lift up and rotate down the camera while rotating the background in the same way and adjusting mesh collider or plane (for the walk)  position without rotating them down. In this way I can give perspective to the character without distorting my background. I've seen that I can also connect the plane with the background to the camera as a child.
    Could this be a way to go?
  • Absolutely - the built-in background image/camera syncing for 2.5D games is a convenience, but it's not necessary to use if something else is more appropriate.

    You've seen in the tutorials that even a 2D camera can be used - and also know that if a 2D camera's Perspective field is set to Projection, then giving a Horizontal or Vertical Offset value will cause the perspective to shift in the way I mentioned in the other thread.

    You can also attach the Limit visibility component to your background so that it will only show when that particular camera is active, meaning you can have other cameras/backgrounds in the scene without them interfering with one another.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.