- Home /
how to find existing cloth position?
I created a cloth witch works exactly as I wanted and made it prefab
but I want to attach script to it that when it stops I know it's possition
so how do I know last mesh position? this reads only 1. position
I've followed This and (This But I don't want to create new cloth/mesh whatever) I want to follow existing one
I'm trying with:
using UnityEngine;
using System.Collections;
[System.Serializable]
public class Dirt : MonoBehaviour {
public InteractiveCloth InterCloth ;
public Vector3[] verticals ;
void Update (){
verticals = InterCloth.mesh.vertices ;
}
}
and I can drag interactive cloth from editor in to the slot but it seems it only reeds the beginning of mesh
and where could I find script:
inspecter window dubble click in Object to follow?
as it seems that it follows the Game Object correctly and not transform.position of object
Answer by sdgd · Feb 04, 2013 at 01:53 PM
oh crap I must not follow mesh but InteractiveCloth
using UnityEngine;
using System.Collections;
[System.Serializable]
public class Dirt : MonoBehaviour {
public InteractiveCloth InterCloth ;
public Vector3[] verticals ;
void Update(){
verticals = InterCloth.vertices ;
}
}
this works
this is constantly updated
seems that mesh verticals are local and this is global
Your answer
Follow this Question
Related Questions
Why is my script-crafted mesh invisible in game-mode? (C#) 1 Answer
Camera rotation around player while following. 6 Answers
Find right mesh for collider 1 Answer
Cloth, Mesh or Terrain for wavy sea water? 2 Answers
NPC flying towards me!!! 1 Answer