The normals of the mesh.
If the mesh contains no normals an empty array will be returned.
#pragma strict // Rotate the normals by speed every frame var speed: float = 100.0f; // Update is called once per frame function Update() { // obtain the normals from the mesh var mesh: Mesh = GetComponent.<MeshFilter>().mesh; var normals: Vector3[] = mesh.normals; // edit the normals in an external array var rotation: Quaternion = Quaternion.AngleAxis(Time.deltaTime * speed, Vector3.up); for (var i: int = 0; i < normals.Length; i++) normals[i] = rotation * normals[i]; // assign the array of normals to the mesh mesh.normals = normals; }
// Rotate the normals by speed every frame
using UnityEngine;
public class ExampleClass : MonoBehaviour {
float speed = 100.0f; // Update is called once per frame void Update () {
// obtain the normals from the mesh Mesh mesh = GetComponent<MeshFilter>().mesh; Vector3[] normals = mesh.normals; // edit the normals in an external array Quaternion rotation = Quaternion.AngleAxis(Time.deltaTime * speed, Vector3.up); for (int i = 0; i < normals.Length; i++) normals[i] = rotation * normals[i];
// assign the array of normals to the mesh mesh.normals = normals; } }