- Home /
Question by
captain_roro · Jul 19, 2017 at 07:30 AM ·
c#gameobjectmovement scriptonclick
Moving GameObjects on elliptical way after clicking on them
Hello people. I have many objects on my scene. When I click on these objects, they should move to the bag. I want to share this scene basically with 2 objects,
My objects can move on green path for that purpose. This can be possible with,
item.transform.position = Vector3.MoveTowards(transform.position, target.position, Time.deltaTime*40);
However, these objects should follow like yellow path. I use C#. How can this be possible? Thanks in advance.
move.png
(48.2 kB)
Comment
Best Answer
Answer by ZeN12 · Jul 19, 2017 at 07:39 AM
You can use bezier curves for this. Good asset for this: https://www.assetstore.unity3d.com/en/#!/content/3595
I didn't use LeanTween but I tried iTween and it works. Thank you for answer