Skip to content

Instantly share code, notes, and snippets.

@iwanPlays
Created June 16, 2021 20:13
Show Gist options
  • Save iwanPlays/7fdd3cde93adc84d67e28d4d11aa5370 to your computer and use it in GitHub Desktop.
Save iwanPlays/7fdd3cde93adc84d67e28d4d11aa5370 to your computer and use it in GitHub Desktop.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.AI;
public class NavigationBaker : MonoBehaviour {
public NavMeshSurface[] surfaces;
public Transform[] objectsToRotate;
// Use this for initialization
void Update ()
{
for (int j = 0; j < objectsToRotate.Length; j++)
{
objectsToRotate [j].localRotation = Quaternion.Euler (new Vector3 (0, 50*Time.deltaTime, 0) + objectsToRotate [j].localRotation.eulerAngles);
}
for (int i = 0; i < surfaces.Length; i++)
{
surfaces [i].BuildNavMesh ();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment