gui element movement and repositioning

Updated on October 2, 2018 in [A] Unity Scripting
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
0 on October 2, 2018

Hi, guys, im trying to move two gui element after each other in canvas and once it reaches a position, i want it to reposition to the start position but the gui element movement isnt accurate, both gui element leaves a space between then after few movements..

Below is the repositioning code


 public Transform start;
 public Transform finish;
 void Update () {
 if (Transform.position.x >= (start.position.x)) {
 Reposition ();
 private void Reposition(){
Transform.position = finish.position;

this is the movement code

 private Rigidbody2D rb;
 float scrollSpeed; 
 // Use this for initialization
 void Start () {
 rb = GetComponent<Rigidbody2D>();
// Update is called once per frame
 void Update () {
 scrollSpeed = 1000f;
 rb.velocity = new Vector2 (scrollSpeed, 0); 



Please help

  • Liked by