I am working on a piece of code using itween that move’s a game object left and right and I keep it in a ping pong loop. After I press a button, it calls the stop by name function and the object stops (as it should) but it stops at the last position and I want to set it to a specific position. I tried using gameobject.transform.position = new vector3(0,0,0) and it works perfectly. However, it restrains the object from moving again. Is there a way to arrange the game object’s position the way I want it? Thank you in advance.
Have you tried creating a variable to hold the “at rest” position instead of just setting the transform? That way it could either be ping-ponging OR set to its default position, allowing you to transition between the two.
I don’t use iTween much, so apologies if I steer you wrong.