Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First person camera controls are faulty #63

Open
campbellgoe opened this issue May 16, 2024 · 3 comments
Open

First person camera controls are faulty #63

campbellgoe opened this issue May 16, 2024 · 3 comments

Comments

@campbellgoe
Copy link

When I go into first person perspective, and move the mouse around, often the camera/character rotate.

const MyEcctrl = forwardRef(({ children, pos, perspective = THIRD_PERSON, props = {} }, ref) => {
  return <Ecctrl
    ref={ref}
    dampingC={0.1}
    floatingDis={1.5} 
    autoBalance={false}
    animated
    position={pos}
    jumpVel={0}
    {...(perspective === FIRST_PERSON ? {
      camInitDis:-0.01,
      camMinDis:-0.01,
      camFollowMult: 100,
      turnVelMultiplier: 1,
      turnSpeed: 10,
      mode: "CameraBasedMovement"
    } : {})}
    {...props}
  >{children}</Ecctrl>
})

Here's my code.

Any idea how to stop this bug?

@ErdongChen-Andrew
Copy link
Member

I don't quite understand the bug. Do you have any videos?

@campbellgoe
Copy link
Author

hmm I can no longer reproduce it. could have been a weird mouse issue but well it was rotating to some other orientation instead of keeping the first person view stable with the mouse.

@NicolasBrondin
Copy link

@campbellgoe This can happen if you release your mouse click outside of the browser's window. Then when the cursor comes back on the page, the character rotates even if mouse is not clicked.

Clicking again in the page solves the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants