- Home /
Need to change iTween Path End Node position to Right Edge of the Screen
I have a parent game object which is having the transform position (0.68, -2.23, 0) and Scale (1,1,1). There are several child objects which is having the transform position (15, -2.14, 0) and scale (1.5,1.5,1). Now I'm using iTween path to move these child gameobjects from one side of the screen to the other side in a curved path as shown in the image below:
The pathname is orderPath. Now here comes my issue. The Ending Node now needs to be on the right edge of the screen. Right edge has to be detected at the start of the game and the child game object should move from start position and its end position has to be on the right edge of the screen.
I'm now using
iTween.MoveTo(this.gameObject, iTween.Hash("path", iTweenPath.GetPath("orderpath"), "time", 1, "delay",CollectibleDelay,"easetype", iTween.EaseType.easeInOutSine, "oncomplete", "StartMovement", "oncompletetarget", this.gameObject));
this code to move through this path. The game is a landscape oriented 2D game. I have used 2 cameras in this game. One for rendering UI game objects and the other for world 2D game objects. So my question is , Is there any way to move my object from the start position to the right edge of the screen?