# Tweening with OrbitControls

**URL:** https://discourse.threejs.org/t/tweening-with-orbitcontrols/17356
**Category:** Questions
**Tags:** animation
**Created:** [July 23, 2020, 6:25pm UTC](https://discourse.threejs.org/t/tweening-with-orbitcontrols/17356 "2020-07-23T18:25:52Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![emdax](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/emdax/32/2602_2.png) [@emdax](https://discourse.threejs.org/u/emdax)
#### Post date: [July 23, 2020, 6:25pm UTC](https://discourse.threejs.org/t/tweening-with-orbitcontrols/17356/1 "2020-07-23T18:25:53Z")

</div>

Is there a way to Tween/Animate transitions with OrbitControls ?

Tweening camera directly while using OrbitControls causes jitter effect.

---

<div class="post-metadata">

### Author: ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)
#### Post date: [July 23, 2020, 6:42pm UTC](https://discourse.threejs.org/t/tweening-with-orbitcontrols/17356/2 "2020-07-23T18:42:19Z")

</div>

Maybe the following fiddle helps: [https://jsfiddle.net/u9273yqz/](https://jsfiddle.net/u9273yqz/)

In general, I would always disable controls when an animation starts and enable it again when the animation is completed. In context of `OrbitControls`, you have to call the respective `update()` method to ensure the camera looks at the respective focus point when its position is animated.

All this stuff is implemented in the live example with GSAP 3.

---

<div class="post-metadata">

### Author: ![emdax](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/emdax/32/2602_2.png) [@emdax](https://discourse.threejs.org/u/emdax)
#### Post date: [July 24, 2020, 11:05pm UTC](https://discourse.threejs.org/t/tweening-with-orbitcontrols/17356/3 "2020-07-24T23:05:34Z")

</div>

Brilliant. Thank You Mugen87. This works. Your example is perfect. onUpdate:function() {controls.update(); } is the key.

Is there a way to animate the OrbitControls focus point ?

---

<div class="post-metadata">

### Author: ![Mugen87](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/mugen87/32/5645_2.png) [@Mugen87](https://discourse.threejs.org/u/Mugen87)
#### Post date: [July 25, 2020, 9:02am UTC](https://discourse.threejs.org/t/tweening-with-orbitcontrols/17356/4 "2020-07-25T09:02:55Z")

</div>

> [@emdax](#):
>
> Is there a way to animate the OrbitControls focus point ?

You can animate `OrbitControls.target` in the same way you do it for `camera.position`.

---

<div class="post-metadata">

### Author: ![emdax](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/emdax/32/2602_2.png) [@emdax](https://discourse.threejs.org/u/emdax)
#### Post date: [July 25, 2020, 5:11pm UTC](https://discourse.threejs.org/t/tweening-with-orbitcontrols/17356/5 "2020-07-25T17:11:36Z")

</div>

Works. Outstanding. Thanks Mugen87!

---

<div class="post-metadata">

### Author: ![jaronimoe](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jaronimoe/32/21731_2.png) [@jaronimoe](https://discourse.threejs.org/u/jaronimoe)
#### Post date: [October 19, 2021, 3:58pm UTC](https://discourse.threejs.org/t/tweening-with-orbitcontrols/17356/6 "2021-10-19T15:58:42Z")

</div>

hi Mugen87, I just tried to combine the tween to the `OrbitControls.target` **and** the `camera.position` - however, I could not find the correct way to do so - my controls stay locked as soon as I try to tween to` [camera.position, controls.target]`…

how do I combine two tweens if they have the same target (lookat and destination)?  
how would I combine two tweens if they have different targets?

I tried calling them sequentially, I tried giving an array of two objects to the selector, and I tried calling one from the `onComplete` of the other - however my controls remain locked afterwards… help please!

---

<div class="post-metadata">

### Author: ![jaronimoe](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jaronimoe/32/21731_2.png) [@jaronimoe](https://discourse.threejs.org/u/jaronimoe)
#### Post date: [October 19, 2021, 4:16pm UTC](https://discourse.threejs.org/t/tweening-with-orbitcontrols/17356/7 "2021-10-19T16:16:59Z")

</div>

okay, actually this approach seems to work in the jsfiddle using `[camera.position, controls.target]` - however in my code the camera jumps somewhere else as soon as the tween is finished and the controls remain locked - but only if I tween to both parameters. if I just tween to either the cam.position or the controls.target it works fine. very confused…

---

<div class="post-metadata">

### Author: ![looeee](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/looeee/32/59_2.png) [@looeee](https://discourse.threejs.org/u/looeee)
#### Post date: [October 20, 2021, 2:28am UTC](https://discourse.threejs.org/t/tweening-with-orbitcontrols/17356/8 "2021-10-20T02:28:17Z")

</div>

For animation and orbit controls I reccomend using Yomutsu’s [Camera Controls](https://www.npmjs.com/package/camera-controls) instead of OrbitControls since they are built with animation in mind, whereas with OrbitControls you are fighting against them.

---

<div class="post-metadata">

### Author: ![jaronimoe](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jaronimoe/32/21731_2.png) [@jaronimoe](https://discourse.threejs.org/u/jaronimoe)
#### Post date: [October 20, 2021, 7:57am UTC](https://discourse.threejs.org/t/tweening-with-orbitcontrols/17356/9 "2021-10-20T07:57:17Z")

</div>

I found the mistake in my code - camera pos and lookat where the same target vector which destroyed the orbit controls. now I need to find a way to animate simultaneously to two different targets for two different objects.

EDIT: simply calling gsap sequentially creates a parallel interpolation 👍

---

<div class="post-metadata">

### Author: ![jimenghua](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/jimenghua/32/20754_2.png) [@jimenghua](https://discourse.threejs.org/u/jimenghua)
#### Post date: [December 8, 2021, 6:46am UTC](https://discourse.threejs.org/t/tweening-with-orbitcontrols/17356/10 "2021-12-08T06:46:28Z")

</div>

I met a similar problem with you, may I ask if you have solved it? If possible, please show me your solution, which will help me a lot
