- Home /
Move an Object to a separate area/NavMesh
New to Unity and am struggling with the best way to do something.
Working on an RTS where my workers must gather resources and return them to their "home base", a Fort.
The Fort is a totally separate area/view than the world. For example, worker gathers berries in the world, then moves back to the Fort object. In the outside world, the Fort appears small, just a cube object at the moment. When the worker collides with the Fort cube object, he should be taken to the Fort area/view with buildings, etc.
So at the same time, there are workers inside the Fort view and outside in the world view.
The player should be able to switch back and forth between the outside world view and the Fort view quickly.
- Should the outside world view and the Fort view be 2 separate areas within 1 scene? This is how I have it setup now. I am prototyping and have very small areas. Outside world terrain object is at (0,0,0) and Fort terrain object is at (0,0,35)
However, I cannot move a worker to the Fort area. When the worker enters the Fort in the world view, I attempt to simple "transport" the worker to the entrance of the Fort view by doing "transform.position = new Vector3(-15, 0, 50)"
But when I do this, the worker is blocked by the z-axis boundary of the world view and stays on the world terrain object. I cannot move him over to the Fort terrain object. Not sure if this is NavMesh related or what. I have the NavMesh baked for both areas.
- How else should I have 2 simultaneous areas like this? 2 separate scenes that run at the same time? Is there another way?
Hope I explained this well. Thanks for any thoughts!
Your answer
Follow this Question
Related Questions
Group Movement (RTS style) using Unity Pro NavMesh 0 Answers
Click to Move With Navmesh 0 Answers
best pathfinding system? 1 Answer
Movement with NavMeshAgent pushes RigidBody 1 Answer
How to move NavMesh Agent by animation? 2 Answers