# Where in the class hierarchy of TargetCamera is 'rotation\`

**URL:** https://forum.babylonjs.com/t/where-in-the-class-hierarchy-of-targetcamera-is-rotation/37136
**Category:** Questions
**Created:** [January 5, 2023, 4:25pm UTC](https://forum.babylonjs.com/t/where-in-the-class-hierarchy-of-targetcamera-is-rotation/37136 "2023-01-05T16:25:11Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)
#### Post date: [January 5, 2023, 4:25pm UTC](https://forum.babylonjs.com/t/where-in-the-class-hierarchy-of-targetcamera-is-rotation/37136/1 "2023-01-05T16:25:11Z")

</div>

I have a base of source code, going back to the beginning, of changing where a camera is “pointed” by assigning the x/y/z of `rotation`.

Neither of my sources were “vetted” by typescript though:

- a Blender python addon to generate JS source code
- a component of my animation system to move/rot/scale `BABYLON.Node` objects. Lights use `direction`, so `<BABYLON.Vector3> this._node[this._rotationProperty]` is what is lerped.

I now have a need to rotate a `TargetCamera`, but `rotation` is not a valid property according to Typescript. I searched source hierarchy, TargetCamera/Camera/Node, and have not found either.

* * *

Along the way I tried to set `cameraDirection`, but not working & has side effects.

---

<div class="post-metadata">

### Author: ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)
#### Post date: [January 5, 2023, 4:48pm UTC](https://forum.babylonjs.com/t/where-in-the-class-hierarchy-of-targetcamera-is-rotation/37136/2 "2023-01-05T16:48:39Z")

</div>

Just to clarify, I just did a `camera["rotation"].y = x`. It works, so I do not have a performance issue

---

<div class="post-metadata">

### Author: ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)
#### Post date: [January 5, 2023, 4:49pm UTC](https://forum.babylonjs.com/t/where-in-the-class-hierarchy-of-targetcamera-is-rotation/37136/3 "2023-01-05T16:49:02Z")

</div>

Here is it: [Babylon.js/targetCamera.ts at master · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/blob/master/packages/dev/core/src/Cameras/targetCamera.ts#L48)

---

<div class="post-metadata">

### Author: ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)
#### Post date: [January 5, 2023, 4:49pm UTC](https://forum.babylonjs.com/t/where-in-the-class-hierarchy-of-targetcamera-is-rotation/37136/4 "2023-01-05T16:49:22Z")

</div>

Maybe you have a type issue? is your camera object of TargetCamera type?

---

<div class="post-metadata">

### Author: ![JCPalmer](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jcpalmer/32/42_2.png) [@JCPalmer](https://forum.babylonjs.com/u/JCPalmer)
#### Post date: [January 5, 2023, 5:08pm UTC](https://forum.babylonjs.com/t/where-in-the-class-hierarchy-of-targetcamera-is-rotation/37136/5 "2023-01-05T17:08:09Z")

</div>

Ok, but I swear it was not in the source. Problem there was probably having too many things open at once.

Typescript (via the editor) did give an error. I was casting from a `Camera`, but still using the `Camera` property when trying to set rotation.
