Skip to content

Commit

Permalink
✨ Initialise camera looking straight forward
Browse files Browse the repository at this point in the history
  • Loading branch information
malted committed Jun 23, 2022
1 parent 3a9b1b6 commit bcf151f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "charactercontroller",
"version": "2.0.1",
"version": "2.1.0",
"description": "A first person character controller for the Three.js graphics library",
"main": "src/index.js",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Group, Clock, PerspectiveCamera, Raycaster, Vector3 } from "three";
import { Group, Clock, PerspectiveCamera, Raycaster, Vector3, MathUtils } from "three";
import * as PlayerUtils from "./playerUtils.js";

export default class CharacterController {
Expand Down Expand Up @@ -49,6 +49,7 @@ export default class CharacterController {
0.1,
1000
);
this.camera.rotation.x = MathUtils.degToRad(90);
this.player.add(this.camera);

this.keysDown = {};
Expand Down

0 comments on commit bcf151f

Please sign in to comment.