pmndrs / ecctrl

🕹ī¸ A floating rigibody character controller
MIT License
467 stars 50 forks source link

How to do third person without mouse lock #14

Closed lt15364967740 closed 7 months ago

lt15364967740 commented 8 months ago

I can control the movement of the character, but I don't know how to change the position of the camera, and use the mouse to control the camera to rotate around the objec

ErdongChen-Andrew commented 8 months ago

Just to clarify, are you looking for camera control without enabling pointer lock, or would you like to know how to enable pointer lock?

lt15364967740 commented 8 months ago

Just to clarify, are you looking for camera control without enabling pointer lock, or would you like to know how to enable pointer lock? I'm looking for a camera without a mouse lock

ErdongChen-Andrew commented 8 months ago

At the moment, it only supports pointer lock camera control. I'm thinking about adding drag control to the camera later on 🤔

lt15364967740 commented 8 months ago

At the moment, it only supports pointer lock camera control. I'm thinking about adding drag control to the camera later on 🤔

OK, thank you.

ErdongChen-Andrew commented 8 months ago

@lt15364967740 , you can now use follow cam without pointer lock (version 1.0.42)

lklyne commented 7 months ago

@ErdongChen-Andrew whats the process for disabling the pointer lock on a web browser? Not seeing a prop to turn it off, but it looks like its possible to unlock the mouse and only pan with drag.

ErdongChen-Andrew commented 7 months ago

@lklyne you can remove the requestPointerLock from the canvas component:

<Canvas
  shadows
  /// onPointerDown={(e) => {
  ///   (e.target as HTMLCanvasElement).requestPointerLock();
  /// }}
>
lklyne commented 7 months ago

@ErdongChen-Andrew that was easy — totally overlooked that. Thank you!!