# Place the light based on the user's viewing position

**URL:** <https://forum.babylonjs.com/t/place-the-light-based-on-the-users-viewing-position/15833>\
**Category:** Questions\
**Created:** [November 19, 2020, 9:07am UTC](https://forum.babylonjs.com/t/place-the-light-based-on-the-users-viewing-position/15833 "2020-11-19T09:07:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stef](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/stef/32/7228_2.png) [@Stef](https://forum.babylonjs.com/u/Stef)\
**Post date:** [November 19, 2020, 9:07am UTC](https://forum.babylonjs.com/t/place-the-light-based-on-the-users-viewing-position/15833/1 "2020-11-19T09:07:47Z")

</div>

Hey,

i want to place the Light, which shine to the 3D Model, on the User’s viewing position, that the User which looking this 3D Model have at every Place light and can see all.

I have only founded the 4 Types of Lights but nothing like this.

Is there a Way?

Regards

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [November 19, 2020, 10:22am UTC](https://forum.babylonjs.com/t/place-the-light-based-on-the-users-viewing-position/15833/2 "2020-11-19T10:22:27Z")

</div>

You can update the light position so that it is always following the camera position:

```javascript
scene.onBeforeRenderObservable.add(() => {
    light.position.set(camera.position.x, camera.position.y, camera.position.z);
});

```

Or you can simply set the light position equals to the camera position:

```javascript
light.position = camera.position;

```

---

<div class="post-metadata">

**Author:** ![Stef](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/stef/32/7228_2.png) [@Stef](https://forum.babylonjs.com/u/Stef)\
**Post date:** [November 26, 2020, 12:18pm UTC](https://forum.babylonjs.com/t/place-the-light-based-on-the-users-viewing-position/15833/3 "2020-11-26T12:18:36Z")

</div>

> [@Evgeni\_Popov](#):
>
> ```auto
> scene.onBeforeRenderObservable.add(() => {
> light.position.set(camera.position.x, camera.position.y, camera.position.z);
> });
> 
> ```

Thank you very much Evgeni 🙂
