# Camera Orbit Offset After Reset

**URL:** <https://forum.needle.tools/t/camera-orbit-offset-after-reset/2867>\
**Category:** 🌵 Needle Engine\
**Tags:** bug\
**Created:** [August 13, 2026, 1:46pm UTC](https://forum.needle.tools/t/camera-orbit-offset-after-reset/2867 "2026-08-13T13:46:32Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ashokkumar\_KR](https://forum.needle.tools/user_avatar/forum.needle.tools/ashokkumar_kr/32/4207_2.png) [@Ashokkumar\_KR](https://forum.needle.tools/u/Ashokkumar_KR)\
**Post date:** [August 13, 2026, 1:46pm UTC](https://forum.needle.tools/t/camera-orbit-offset-after-reset/2867/1 "2026-08-13T13:46:32Z")

</div>

I’m resetting the camera using:

```auto
this.baseCamera.setCameraAndLookTarget(cam);

```

This works correctly in most scenarios. However, on some occasions, although the camera returns to the expected position and view, it appears to lose its orbit center.

As a result, when the user starts rotating the camera, it rotates around a much larger radius instead of the intended pivot point.

I’ve attached a video demonstrating the issue for reference and have also submitted a bug report.

Link: [Transfer - Dropbox](https://www.dropbox.com/t/nntr3V4A6oBkT2kh)

---

<div class="post-metadata">

**Author:** ![needle-assistant](https://forum.needle.tools/user_avatar/forum.needle.tools/needle-assistant/32/3415_2.png) [@needle-assistant](https://forum.needle.tools/u/needle-assistant)\
**Post date:** [August 13, 2026, 1:46pm UTC](https://forum.needle.tools/t/camera-orbit-offset-after-reset/2867/2 "2026-08-13T13:46:32Z")

</div>

The issue is likely that `setCameraAndLookTarget` expects **two arguments** : the camera position and the look target (orbit center). You’re only passing one object (`cam`). If `cam` doesn’t contain both positions, the orbit target defaults to (0,0,0) or whatever was last set, causing the large radius.

Try this:

```ts
this.baseCamera.setCameraAndLookTarget(
  cameraPositionVector, // Vector3
  lookTargetVector // Vector3
);

```

If you need the current look target, read it from `OrbitControls.lookTarget` before the reset. This is a setup issue, not a bug.

_4 replies left_  
_**Reply to this post directly if you need further help (bottom right button)**_

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [August 13, 2026, 1:56pm UTC](https://forum.needle.tools/t/camera-orbit-offset-after-reset/2867/3 "2026-08-13T13:56:27Z")

</div>

Hello @Ashokkumar_KR

The AI is correct here and this method expects two arguments, please see our API documentation: [OrbitControls | Needle Engine](https://engine.needle.tools/docs/api/classes/Built-in_Components.OrbitControls.html#setcameraandlooktarget). If you just want to set the lookAt target (orbit center) or just the camera position please use the respective methods.

---

<div class="post-metadata">

**Author:** ![Ashokkumar\_KR](https://forum.needle.tools/user_avatar/forum.needle.tools/ashokkumar_kr/32/4207_2.png) [@Ashokkumar\_KR](https://forum.needle.tools/u/Ashokkumar_KR)\
**Post date:** [August 13, 2026, 2:10pm UTC](https://forum.needle.tools/t/camera-orbit-offset-after-reset/2867/4 "2026-08-13T14:10:35Z")

</div>

setCameraAndLookTarget(source: Object3D | Camera, immediateOrDuration?: number | boolean): boolean;

It expects a camera, and I’m passing it?

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [August 13, 2026, 2:12pm UTC](https://forum.needle.tools/t/camera-orbit-offset-after-reset/2867/5 "2026-08-13T14:12:21Z")

</div>

But it does also set the orbit point by raycasting:

`source: The object to raycast from. If a camera is passed in the camera position will be used as the source`

If you just want to set the camera position you can use [OrbitControls | Needle Engine](https://engine.needle.tools/docs/api/classes/Built-in_Components.OrbitControls.html#setcameratargetposition) (if you have a Camera component you can pass in `camera.gameObject` to access the Object3D)

---

<div class="post-metadata">

**Author:** ![Ashokkumar\_KR](https://forum.needle.tools/user_avatar/forum.needle.tools/ashokkumar_kr/32/4207_2.png) [@Ashokkumar\_KR](https://forum.needle.tools/u/Ashokkumar_KR)\
**Post date:** [August 14, 2026, 9:58am UTC](https://forum.needle.tools/t/camera-orbit-offset-after-reset/2867/6 "2026-08-14T09:58:17Z")

</div>

Even in that case, the output should be the same, right? I’m passing the exact same `cam` object in both scenarios.

In around 90% of cases, `this.baseCamera.setCameraAndLookTarget(cam)` produces the expected result. However, in some cases, the camera moves to the correct position and orientation, but the orbit target seems to become offset.

In the bug report I shared, I’m passing the same `cam` to the same `mainCamera` in both scenes. One scene behaves correctly, while the other ends up with an incorrect orbit pivot?

---

<div class="post-metadata">

**Author:** ![Robert\_Dorn](https://forum.needle.tools/user_avatar/forum.needle.tools/robert_dorn/32/4561_2.png) [@Robert\_Dorn](https://forum.needle.tools/u/Robert_Dorn)\
**Post date:** [August 18, 2026, 2:08pm UTC](https://forum.needle.tools/t/camera-orbit-offset-after-reset/2867/7 "2026-08-18T14:08:18Z")

</div>

Hello, i took a look into your Bugreport Project.

With this specific object the raycasts from setCameraAndLookTarget go through the holes in the mesh.

So in this case, i would recommend to use [setLookTargetPosition](https://engine.needle.tools/docs/api/classes/Built-in_Components.OrbitControls.html#setlooktargetposition)and [setCameraTargetPosition](https://engine.needle.tools/docs/api/classes/Built-in_Components.OrbitControls.html#setcameratargetposition) methods from OrbitControls to set the camera view and look target point.

Just a note: If you use AI for your work we recommend that you install the Needle Engine AI skill (or use our MCP) for additional help: [AI & Needle Engine | docs](https://engine.needle.tools/docs/ai/)

---

<div class="post-metadata">

**Author:** ![Marcel\_Wiessler1](https://forum.needle.tools/user_avatar/forum.needle.tools/marcel_wiessler1/32/21_2.png) [@Marcel\_Wiessler1](https://forum.needle.tools/u/Marcel_Wiessler1)\
**Post date:** [August 24, 2026, 1:39pm UTC](https://forum.needle.tools/t/camera-orbit-offset-after-reset/2867/8 "2026-08-24T13:39:30Z")

</div>

Hello, did the previous reply answer your question? Did you try the suggested method?

---

<div class="post-metadata">

**Author:** ![Ashokkumar\_KR](https://forum.needle.tools/user_avatar/forum.needle.tools/ashokkumar_kr/32/4207_2.png) [@Ashokkumar\_KR](https://forum.needle.tools/u/Ashokkumar_KR)\
**Post date:** [August 24, 2026, 1:58pm UTC](https://forum.needle.tools/t/camera-orbit-offset-after-reset/2867/9 "2026-08-24T13:58:46Z")

</div>

yeah. I used the suggested methods, and initial impressions it looks fine.

This is what i came up with

```typescript
setCameraAndTargetForBaseCamera(cam: Camera) {

    if (!cam || !this.baseCamera)

      return;

    const model = ComponentDataContainer.instance.goTarget;

    if (!model)

      return;

    const source = cam.gameObject;

    this.baseCamera.setCameraTargetPosition(

      source

    );

    const box = this.modelBox || new Box3().setFromObject(model);

    const center = new Vector3();

    if (box.isEmpty()) {

      center.copy(model.worldPosition);

    }

    else {

      box.getCenter(center);

    }

    const distance = source.worldPosition.distanceTo(center);

    const forward = new Vector3(0, 0, -1)

      .applyQuaternion(source.worldQuaternion)

      .normalize();

    const target = new Vector3()

      .copy(source.worldPosition)

      .addScaledVector(forward, distance);

    this.baseCamera.setLookTargetPosition(

      target

    );

  }

```
