Hello
I’m having a problem that I don’t know how can I solved.
In my game, I have some holes, when my player down on hole his return to first position.
After this is happen my player stay crazy, his lost position, animator, collisions, everything and I don’t know how can I solve this problem and why it happens
look at problem in this video: - YouTube
public class CanyonControl : MonoBehaviour {
public Transform player;
private Vector3 playerPosition;
// Use this for initialization
void Start () {
playerPosition = player.position;
}
// Update is called once per frame
void Update () {
}
void OnCollisionEnter2D(Collision2D coll){
if(coll.gameObject.name.Equals("PlayerObject")){
player.position = playerPosition;
}
}
}