Is this possible? I've only found external and random acceleration- any way to make it local ?
Use TransformDirection method to easily convert global direction to transform local direction.
using UnityEngine;
public class ClothRenderer : MonoBehaviour
{
public Vector3 externalAcceleration = new Vector3(0f, 0f, -4f);
public Vector3 randomAcceleration = new Vector3(1f, 1f, 0f);
public Cloth cloth;
private void FixedUpdate(){
cloth.externalAcceleration = transform.TransformDirection(externalAcceleration);
cloth.randomAcceleration = transform.TransformDirection(randomAcceleration);
}
}
This won’t work for me because I’m making a mod for a game that doesn’t load custom scripts.