- Home /
Question by
sdgd · Mar 02, 2013 at 11:39 PM ·
c#clothmanipulation
How to manipulate Cloth with script? - OR how to reset cloth
I've been trying to do it with This
using UnityEngine;
using System.Collections;
[System.Serializable]
public class Dirt : MonoBehaviour {
public InteractiveCloth InterCloth ;
public void ImThrownToWorldF (Vector3 PlayerPos){
// Mesh mesh = GetComponent<MeshFilter>().mesh; -- Gives me that it's null
Debug.Log("we are in");
for (int i=0; i<InterCloth.vertices.Length; i++) {
InterCloth.vertices[i] = PlayerPos;
}
}
problem is nothing changes
and I need it because I would like to change it's transform position in front of player
as changing GameObject position does nothing
or is there a posibility to reset the cloth to start from 0 so it starts from new GameObject' transform.position?
Comment
Any luck with this? Been trying to move my cloth manually too and it's not easy.....