Unity Navmesh and Procedurally generated map - c#

I'm using Unity's navmesh Ai to to make an Ai that follows the player in a procedurally generated map. Moreover, I'm making a backrooms game and the Ai is for an entity. And my problem is that you need to bake the surrounding with "walkable" and "jump" objects. But I'm unable to do that for a map that is constantly changing.
I dont have any Idea of how Im supposed it to make it work with a generated map, only with an already built map that never changes.

Related

Sprites disappear after game is built (unity engine C#) Not an issue of layer they are on

I am currently writing a 2D game in unity and whenever I build the actual game, the sprites all disappear, the player is the only thing that remains.
However, the sprites are still there, just invisible. It's not an issue of order of layer and am having trouble fixing it.
I am using SpriteShapeController.
SpriteShapeController auto shows as it having a sprite so it made me think I had a sprite already
I just made Custom Square Sprites and added them in.

How to always get the AR design in front of the spatial walls Unity HoloLens

I am building an app for the HoloLens gen 1 device using Unity 2018.3.13f and MRTK V2 RC1. I got a simple AR design with 2 text objects and 1 rawimage object. After building the project and deploying it to the HoloLens the AR objects ends up behind the spatial mesh (you know all those spatial triangles), but I want all the objects to be in front of the wall.
How do I accomplish this?
The canvas is set to be on the main camera
I have the original settings for the DefaultMixedRealityconfiguraitonProfile if there is something there that needs to be changed.
This is how it looks through the hololens with the app when it does not show the mesh of the wall (sorry for the bad quality)
and this is how it looks when it falls behind the mesh
Do I need to add some mesh renderer or something on the MainCamera to make this possible?
Any help is appreciated, thanks!
I don't believe that the MRTKv2 as of 2019/5/9 has code that will auto-ensure that a specific object is positioned in between the camera and other arbitrary meshes and colliders (i.e. the spatial awareness is one such mesh, though you could imagine just having an arbitrary box or plane in the scene that would occlude that object, in which case, maybe you'd want your "in between" object to stay in between both those two types of potentially occluding things).
There used to be a script in the HTK called Tagalong.cs that would do something like this by doing raycasts from the camera to collidable object:
https://github.com/microsoft/MixedRealityToolkit-Unity/blob/htk_release/Assets/HoloToolkit/Utilities/Scripts/Tagalong.cs
This single large script I think got broken up into smaller scripts (i.e. specific behaviors in the solvers here:)
https://github.com/microsoft/MixedRealityToolkit-Unity/tree/mrtk_release/Assets/MixedRealityToolkit.SDK/Features/Utilities/Solvers
However, from what I can tell, the specific interaction of "keep things automatically between the camera and whatever collidable object" wasn't preserved. Someone else can correct me here if I'm wrong, it looks like this wasn't a behavior that got preserved in V2.
Going forward, there are a couple of possibilities:
1) Probably file an issue on Github here (https://github.com/microsoft/MixedRealityToolkit-Unity/issues) to request this feature be ported over.
2) Use the code in Tagalong.cs to add your own solver that would accomplish this (i.e. the code looks to be all there, there's just some work needed to get done to reorder it to handle what you want)
If you use a sprite renderer, set order in layer (into 0 or -1).
If you use a mesh renderer, try to deactivate dynamic occluded.
Try to change the hierarchy of the sorting layers under Edit-> Project Settings -> Sorting Layers

TILED 2D Tilemap is jumpy/jerky in Unity

Using the application Tiled I made a 2D tilemap for a 2D Unity game I am making. The game is very simple, and the map consisted of only some regular tiles, and some with collision detectors. When I import the map into Unity to use for my game with Tiled2Unity, the game loads fine and everything works well, except every now and then the map skips like there is a rendering lag. The jump seems to be independent of the size of the tilemap, does anyone have any idea what the problem could be? I'm happy to answer any questions about the situation.
Here is a picture, you cannot see the problem because it's not a video but here is the situation at least:

Making a tile map

I am creating a tower defense game, i need help with a method or program to make it a tile map so then i can slowly input enemies on a road have turrets that shoot at them etc, i have already tried:
Inputting a picture one by one which i failed on.
Also i tried using the program called tiled but i failed on understand how that makes it tile map so i am pretty lost on the definition on tile map now.
Could someone make some suggestions, links, explanations would be very helpful?
You can load maps generated by 'Tiled' using 'TiledSharp'.
You'll have to figure another way for getting the enemies to move on the map, getting the towers to shoot them, etc. Try this for a start:
Algorithms for realtime strategy wargame AI
You can also try to use Unity3D that might already have something ready for use (unless, of course, the reason is for you to learn the algorithms rather than making the game).
If you need more help please specify exactly what it is you're looking for, i.e. displaying the map, moving the forces, shooting at the forces, UI, etc.

C# XNA Enter Houses

I'm making a role playing game in C# using XNA. I already have a map and some stuff, but that's not interesting at the moment. My question is: How can I give the player the possibility to enter houses or rooms?
To create the worlds, I've used standard int-arrays where each number represents a different type of tile. That works all fine, but the house isn't enterable but a solid textured block of something.
BTW I've used a Vector3 to determine in which world the player's currently located and which one the program must load next.
Any suggestions how I can make the houses enterable?
One easy way to make houses enterable is to create a trigger object at the door of the house.
This object can be a simple Rect along with an id.
While the player moves around your map check for a collision between the player and the trigger.
When the player enters this trigger you can change the displayed map with a new one (the interior of the house) and move the player where the door should lead.
If you're using C# to make a game, you might want to consider switching to MonoGame (which is practically XNA's successor since XNA is dead) or Unity.
As mentioned previously, your best option in XNA is to create a Rectangle which will trigger on collision and change the game world.

Categories