I have an object set to math.random and it works fine if I reload the scene, but I need it to move when I click on it, right now it just stays at the same spot unless I reload the scene. How would I make it so that when I click on it it moves to another random spot?
In your touch handler, either on the began phase or ended phase, calculate a new random x and y and change the objects .x and .y properties or use a transition.to() if you want to animate them movement.
Rob
Thanks! But I think I was unclear what I want is it to just pop up at a random spot with you not knowing where it’s going to pop up. Using transition.to() will resulte in an animation leading to where it is going right?
Actually I got what I needed I just had to mess around with the alpha to get what I needed. Thanks!
In your touch handler, either on the began phase or ended phase, calculate a new random x and y and change the objects .x and .y properties or use a transition.to() if you want to animate them movement.
Rob
Thanks! But I think I was unclear what I want is it to just pop up at a random spot with you not knowing where it’s going to pop up. Using transition.to() will resulte in an animation leading to where it is going right?
Actually I got what I needed I just had to mess around with the alpha to get what I needed. Thanks!