# cameras.main.startFollow target.x error

**URL:** <https://phaser.discourse.group/t/cameras-main-startfollow-target-x-error/12722>\
**Category:** Phaser 3\
**Created:** [December 30, 2022, 1:44pm UTC](https://phaser.discourse.group/t/cameras-main-startfollow-target-x-error/12722 "2022-12-30T13:44:12Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![annah](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@annah](https://phaser.discourse.group/u/annah)\
**Post date:** [December 30, 2022, 1:44pm UTC](https://phaser.discourse.group/t/cameras-main-startfollow-target-x-error/12722/1 "2022-12-30T13:44:12Z")

</div>

New to Phaser, I’m just trying to get the camera to follow my player with cameras.main.startFollow but I keep getting the error ‘can’t read undefined x’ (in phaser js file, startFollow function at var fx = target.x - offsetX). Any help appreciated!

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [December 30, 2022, 1:48pm UTC](https://phaser.discourse.group/t/cameras-main-startfollow-target-x-error/12722/2 "2022-12-30T13:48:00Z")

</div>

Show your code please.

---

<div class="post-metadata">

**Author:** ![annah](https://avatars.discourse-cdn.com/v4/letter/a/858c86/32.png) [@annah](https://phaser.discourse.group/u/annah)\
**Post date:** [January 5, 2023, 12:02pm UTC](https://phaser.discourse.group/t/cameras-main-startfollow-target-x-error/12722/3 "2023-01-05T12:02:42Z")

</div>

I solved this problem but have another similar one! My camera won’t move to my player or follow him

 ![Screenshot 2023-01-05 at 11.59.14](https://global.discourse-cdn.com/free1/uploads/phaser1/original/2X/7/7e6c0a430c1985ea341eba82bd33ef7686d23d88.jpeg)

The code is based off the ‘creating your first game example’. I’ve tried the setScroll, centreOn etc. functions but nothing changes. Alternatively, I just want my game origin to be the bottom left corner but changing the bounds also hasn’t worked. Thanks

---

<div class="post-metadata">

**Author:** ![samme](https://yyz2.discourse-cdn.com/free1/user_avatar/phaser.discourse.group/samme/32/5275_2.png) [@samme](https://phaser.discourse.group/u/samme)\
**Post date:** [January 5, 2023, 2:45pm UTC](https://phaser.discourse.group/t/cameras-main-startfollow-target-x-error/12722/4 "2023-01-05T14:45:02Z")

</div>

The `startFollow(player)` is enough; don’t use `setScroll()` or `centerOn()` as well.

Temporarily remove the

```
player.setCollideWorldBounds(true);

```

and see if you get any camera movement.
