pmndrs / pmndrs/ecctrl

How do I change player (ecctrl chid) starting position in my world and also make the camera start from there?

Open
#66 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
797
Forks
98
Avg merge
8m
Merged PRs (30d)
1

Description

I have a custom component which i use as my character for the child as shown below, how do I set a custom initial position for this? I tried using the camTargetPos prop but it moved only the camera and not the player. i tried changing the position of the mesh of my player component but whenever I move it it flies off or falls off infinitely. I hope you can help me out with this.

<Ecctrl
ref={playerRef}
floatHeight={0.05}
maxVelLimit={4}
jumpVel={4}
capsuleRadius={0.35}
capsuleHalfHeight={0.105}

          >
            <Player />
          </Ecctrl>
          
          
    This is the mesh for my player component:
          <mesh
    ref={head}
    geometry={bowlCoverGeometry}
    position={[0, 0.01, 0]}
    scale={[0.6, 0.6, 0.6]}
  >
    <meshBasicMaterial color="sienna" />
  </mesh> 

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Ecctrl component props and playerRef usage shown in the issue, then inspect the controller's positioning and camera-target documentation or examples. Done means documenting or demonstrating how to set the player's initial world position and align the starting camera without relying on mesh position.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, three.js, typescript
Domain
frontend, game-dev
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.