navigation bake for prefabs this is possible? - unity3d

I have a pool of objects, this object are some prefabs, but I can not find the way to do it navigation -> bake work, there is some way to apply thebake to prefabs, or plicate it at run time.
Currently the alternative I am using is to apply the bake to an object in the unity editor and move it where the new part of the pool appears, In the same position, to be able to use the navmesh.
I would like to know if the comment is possible, or if not, the last would be a good alternative, or which would be a good alternative?
I'm sorry for my bad english, I hope you can understand me

Use Unity's advanced features, which is the "NavMeshComponents", you can bake a prefab into a single navmesh and use navmesh link to connect between those prefabs.
There's a github demo about this you can check. I've used that and it works fine.
https://github.com/Unity-Technologies/NavMeshComponents

Related

Why do my 2D objects not collide in Unity despite that the layers are set correctly?

I have a platform that I need to flip the direction of when it collides with an object. The platform as well as its child objects belong to the layer "FlyingOrPlatform". The object that the platform collides with should belong to the "GameControl" layer. But if i set it to that it doesnt collide with it.
If I set the object that the platform collides with to either the "Player" or "Default" layer. Then it works completely as it should. But I wish to use the "GameControl" layer.
I have tried where I save the scene and the project, as well as restarting the editor.
I dont see what should be wrong with my layer setup. Any suggestions?
In my script for reversing the platform direction there is no layer check, it does check the tag but I ensured that the tag is the same when I switch between the layers. I just use Unity's built in OnTriggerEnter2D lifecycle method. Have tested with OnCollisionEnter2D and OnTriggerStay2D as well, same result.
Here is a link to a video demonstrating the issue, as well as a screenshot of my physics2D settings below. In the video I first show how its supposed to work, and then I switch the object the platform collides with to the GameControl layer, after which it doesnt work.
Video of issue: https://www.youtube.com/watch?v=l-eqYI-K-Ug
Physics2D settings:
From what I can tell this appears to be an issue with the Physics2D matrix in Unity that occurs from time to time. A couple of other people have written similar things on other forums.
Among others this reply had a similar issue:
For lack of better, I found a work-around by using the "Ignore Raycast" layer instead of the "GameControl" layer.
I have reported it as a bug to Unity.
EDIT:
Here is the reply I got from Unity.
"Hi,
We successfully reproduced this issue. It will be possible to follow
the progress on a chosen resolution in our public Issue Tracker once
the report has been processed (this might take up to an hour):
https://issuetracker.unity3d.com/product/unity/issues/guid/1325018
We highly appreciate your contribution. If you have further questions,
please feel free to contact us."

Unity 5 3d Shop menu with prefabs

Can someone tell me how to implement other player prefabs as a shop menu LIKE THIS.
I'm going to assume that every pink rectangle is a prefab.
First, you need to understand the concept of prefabs.
Second, you need to know how to instantiate a prefab in run time.
Third, you need to acces the properties for your new fresh instantiate game object so you can change the information of that prefab if you want, maybe you want some values to be 200 instead of 100, idk.
Finally, ther's no "right way" to achieve this, but I recommend you to use Unity UI and scroll rect to achieve your goal.
If you have some time to experiment there will be a good idea to check out a pooling system so you doesn't need to use so much memory at instantiate and destroying objects at runtime, you just reuse them.
Hope it helps.

Having multiple unity scenes open simultaneously

I've been developing a board-style game in Unity3D. The main scene is the board, and has the data about each player and the current (randomly-generated) board stored within it.
I intend to add minigames into the game, for example when landing on a particular space on the board. Naturally, I would like to code the minigame in a separate scene. Is there a way I can do this without losing the instance of the current scene, so that the current scene's state is maintained?
Thanks in advance :)
Short answer: no, but there may be another way to do what you want.
A basic call to Application.LoadLevel call will destroy the current scene before loading the next one. This isn't what you want.
If your minigame is relatively simple, you could use Instantiate to bring in a prefab and spawn it far away from the rest of your scene. You can even use scripts to switch to another camera, toggle player controls and other interactions in the scene, and so on. Once the minigame is done, you can destroy or disable whatever you brought in, and re-enable whatever needs to be turned on in the main scene.
You could create a separate scene and call Application.LoadLevelAdditive to load that scene without destroying the current one. As above, you can then use scripts to manage which cameras and scene behaviors are active.
If you're careful, you don't really need two separate scenes. It may be enough to "fake" a scene switch.
Hard to give a complete answer without code, but you should look into the following things either with the unity documentation or youtube:
PlayerPrefs, this is one way of saving data, although i believe it isn't entirely secure i.e. being able to edit from a text file.
Serializable, this is apparently better than playerprefs.
DonDestroyOnLoad, can carry over information to multiple scenes.
Static variables, again not sure if this will help your particular problem.

Unity3d Nav Mesh Agent avoiding newly created objects

I'm creating a randomly generated terrain game where an enemy will follow after you. The terrain is built after launch through UnityScript. I am using Nav Mesh Agent for the enemies path finding but it is unable to find its way around the newly created objects. Is there a way to update the Nav Mesh after launch to accommodate the new objects? Thanks in advance!
Aside from plugging someone else's asset store product, have you looked at the NavMeshObstacle component? It's intended for dynamic obstacles for avoidance with NavMeshAgents.
And no, you cannot (nor should need to) rebuild the NavMesh at runtime.
As far as I know you cannot rebuild navmesh.
Maybe you should try with Astar pathfinding project http://arongranberg.com/astar/. It's great and used in a lot of commercial games. Free version has option to rebuild navigation graphs.
For next questions about unity3d try here.

Unity: Third Person Collision with Animated Platforms

first time posting on stack and everything looks promising so far! I had a bit of a complicated question here so I'll do my best to provide exact details of what I'd like to get accomplished. I'm working with a third person controller in unity, so far everything is going great. I've dabbled with basic up and down platforms, a little glitchy but things work. Anytime my player runs through a mesh I make sure the mesh collider is working and a 'rigid-body' is attached set to Kinematic. Here's the kicker, in my game I have turning gears which the player can jump on. This is great except for the player doesn't turn with my gear, which would make sense according to my game-play. What would be the process for getting my character to interact with this animated mesh? I imagine some sort of script which my nooby mind cannot fathom at this point in my unity career. If anyone out there knows the solution to this, I would love to have any assistance, either way I'll plugging away at a solution. Thanks again!!
This is assuming that you're using the packages that ship with Unity3D, which it sounds like you are. After importing the Character Controllers package, you'll have a bunch of scripts in the Standard Assets\Character Controllers\Sources\Scripts folder, in the project hierarchy view. There's a script in there called CharacterMotor.js, attach that to the same GameObject you're running ThirdPersonController on.
Essentially this script adds more interactivity between the character and the scene. There's several methods inside this script that automatically move the character when in contact with a moving object (as long as it has a collision mesh) basically by inheriting the object's velocity.
If your gear/cog wheel has a proper collision mesh set up, adding this script to your character should be all that you require.