# Help Me With Spotlight Direction And Angle

**URL:** <https://forum.babylonjs.com/t/help-me-with-spotlight-direction-and-angle/19868>\
**Category:** Questions\
**Tags:** particles, blender, lighting, material, shader\
**Created:** [April 10, 2021, 4:51am UTC](https://forum.babylonjs.com/t/help-me-with-spotlight-direction-and-angle/19868 "2021-04-10T04:51:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alvin\_Stefanus](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/alvin_stefanus/32/3774_2.png) [@Alvin\_Stefanus](https://forum.babylonjs.com/u/Alvin_Stefanus)\
**Post date:** [April 10, 2021, 4:51am UTC](https://forum.babylonjs.com/t/help-me-with-spotlight-direction-and-angle/19868/1 "2021-04-10T04:51:25Z")

</div>

Hello,

I am trying to create 3 spotlights for the object at 0,0,0. My object has Y height about 10 unit.

- The first spotlight should be placed at the camera position and should be following the camera position when rotating the scene.
- The second spotlight should be placed 120 deg from the camera with 0,0,0 rotation anchor. So it should be behind the object.
- The third spotlight should be place -120 deg from the camera with 0,0,0 rotation anchor. So it should be behind the object.

Here is my [https://playground.babylonjs.com/#45FDGY#1](https://playground).

In my playground I use `PointLight`, I want to change into `SpotLight`. I do not know how to set the direction and angle. Please help.

---

<div class="post-metadata">

**Author:** ![srzerbetto](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/srzerbetto/32/20941_2.png) [@srzerbetto](https://forum.babylonjs.com/u/srzerbetto)\
**Post date:** [April 26, 2022, 1:36pm UTC](https://forum.babylonjs.com/t/help-me-with-spotlight-direction-and-angle/19868/3 "2022-04-26T13:36:11Z")

</div>

Hello @Alvin_Stefanus , how are you doing?

I took you playground and modified it to use SpotLights, the trick is to also set the directions appropriately when moving the light around, since your object is in the center you can do that by always setting the direction to be the inverse of the light position. Otherwise, you would have to subtract the light position from the target mesh position.

[Babylon.js Playground (babylonjs-playground.com)](https://www.babylonjs-playground.com/?msclkid=8a6f54a1c56011ecb725b79c7de979cc)
