Quantcast
Channel: Questions in topic: "crash"
Viewing all articles
Browse latest Browse all 2383

I'm trying to make a UI object move from one position to another over time

$
0
0
I have an image acting as the object I want to move as a test. Eventually what I want to do is make the test image become a mask for another image that will act as the object moving underneath it. I'm also hoping to implement an if statement to check if the image has reached a certain point and then resets the image back to its original position. My problem is that when I run the game client, my script causes Unity to stop responding and basically crash. This is the script in question. Any help on why its doing this and advise on how to change it would be appreciated. public Image world; public Vector3 v1 = new Vector3(1, 0, 0); public Vector3 v2 = new Vector3(178, 0, 0); // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { while (world.transform.position != v2) { world.transform.position += v1; } if(world.transform.position == v2) { world.transform.position = v1; }

Viewing all articles
Browse latest Browse all 2383

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>