Fixed indoor scene
This commit is contained in:
@@ -58,13 +58,7 @@ public class Player : BaseCharacter
|
||||
|
||||
public void SetPosition(Transform desiredPosition)
|
||||
{
|
||||
if (!_navAgent.isOnNavMesh)
|
||||
{
|
||||
transform.position = desiredPosition.position;
|
||||
_navAgent.enabled = false;
|
||||
_navAgent.enabled = true;
|
||||
}
|
||||
var t=_navAgent.Warp(desiredPosition.position);
|
||||
_navAgent.Warp(desiredPosition.position);
|
||||
_navAgent.updatePosition = false;
|
||||
Rotate(desiredPosition.forward * -1);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public class IndoorController : MonoBehaviour
|
||||
|
||||
|
||||
// If the NavMeshSurface is not assigned in the Inspector, try to find it
|
||||
var navMeshSurface = transform.GetComponentInChildren<NavMeshSurface>();
|
||||
var navMeshSurface = GetComponent<NavMeshSurface>();
|
||||
|
||||
// Build the NavMesh
|
||||
if (navMeshSurface != null)
|
||||
|
||||
Reference in New Issue
Block a user