# Function for a still camera? WEBGL

**URL:** <https://discourse.processing.org/t/function-for-a-still-camera-webgl/25249>\
**Category:** Beginners\
**Created:** [November 7, 2020, 4:21am UTC](https://discourse.processing.org/t/function-for-a-still-camera-webgl/25249 "2020-11-07T04:21:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![WTnick](https://avatars.discourse-cdn.com/v4/letter/w/41988e/32.png) [@WTnick](https://discourse.processing.org/u/WTnick)\
**Post date:** [November 7, 2020, 4:21am UTC](https://discourse.processing.org/t/function-for-a-still-camera-webgl/25249/1 "2020-11-07T04:21:54Z")

</div>

Hello! I started programming about a month ago. Anyways I was working on a first-person demo and decided to make it so the mouse would move the camera. To test it out I used cam.pan and made it follow mouseX and mouseY. So the camera is panning and being controlled I was wondering if there is a function to set the camera still and make it still follow mouseX and mouseY?

```auto
let cam;

function setup() {
  createCanvas(400, 400, WEBGL);
   cam = createCamera();
}

function draw() {
  background(100,200,300);
      push();
      translate(35, 440,-300);
      box(-900,300,300);
      pop();
  cam.pan(mouseX,mouseY)
}

```

---

<div class="post-metadata">

**Author:** ![tony](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/tony/32/949_2.png) [@tony](https://discourse.processing.org/u/tony)\
**Post date:** [November 7, 2020, 5:01pm UTC](https://discourse.processing.org/t/function-for-a-still-camera-webgl/25249/2 "2020-11-07T17:01:48Z")

</div>

> [@WTnick](#):
>
> is a function to set the camera still and make it still follow mouseX and mouseY?

Can you elaborate? I’m not sure I understand the behavior you want.
