Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


randomAcceleration

A random, external acceleration applied to the cloth.
Read time 1 minuteLast updated 4 days ago

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.ClothModule
public Vector3 randomAcceleration { get; set; }

Remarks

Use this to simulate randomly changing forces on the cloth, such as wind turbulences waving a flag. Additional Resources: Cloth.externalAcceleration.

Examples

using UnityEngine;public class Example : MonoBehaviour{ // Simulate wind going trough the X axis. void Start() { GetComponent<Cloth>().randomAcceleration = new Vector3(10, 0, 0); }}