- Home /
Question by
pyrovoice · Feb 25, 2017 at 05:37 PM ·
movementcharactercontrollerbody
Character controller Skin width no effect
Hey guys, i'm using the character controller component like this : http://i.imgur.com/2D419qT.png
Both units are the same, with a huge skin width, but when I move them they just Superimpose on each other.
Here the movement script : Vector3 travelDestination; bool hasDestination = false;
// Update is called once per frame
void Update () {
if (hasDestination)
{
Vector3 newPosition = Vector3.MoveTowards(this.transform.position, travelDestination, 0.1f);
newPosition.y = Terrain.activeTerrain.SampleHeight(newPosition) +0.2f;
this.transform.position = newPosition;
if (Vector3.Distance(this.transform.position, travelDestination) < Vector3.kEpsilon){
hasDestination = false;
}
}
}
public void setDestination(Vector3 point)
{
hasDestination = true;
travelDestination = point;
}
Would you know why my units don't care abotu each other ? Am I supposed to code something ? Thank you
Comment