From bcf151f47c304cddf39dbfb4deb9bae93cdf14fa Mon Sep 17 00:00:00 2001 From: malted Date: Thu, 23 Jun 2022 10:11:50 +0100 Subject: [PATCH] :sparkles: Initialise camera looking straight forward --- package.json | 2 +- src/index.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index d181db2..221de5d 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src/index.js b/src/index.js index 97f24dc..fbfc638 100644 --- a/src/index.js +++ b/src/index.js @@ -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 { @@ -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 = {};