force traslation

how can I force a movement transform.translate? I have a scene with an enemy that goes back and forth. I used Mathf.pingpong to bring you back. I want to make sure that every time you collide with something Invert its translation but is forced into Update. How can I do?

How are you detecting collisions? Can you post your translation code?

–

1 Answer

1

do{

transform.position.x +=0.2;

}

while(transform.position.x >=100);