当我将disableFollowCam从新设置为false时,这时候相机会突然回到之前disableFollowCam设置为true时的位置,即使我在相机移动时已经将人物的位置设置到新的位置。
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- react, typescript
- Domain
- game-dev
Research direction
Start at the Ecctrl component and trace how disableFollowCam affects camera position and player translation during cameraMoveTo. Reproduce the shown sequence with the camera tween, setTranslation call, and disable changing back to false. Done means the camera remains at its new position instead of returning to its earlier position.
Written by the indexing model from the issue text.
Description
这是我的代码:它实现在第一人称视角的镜头动画,将镜头移动到某个位置。我期望,之后不会再回到动画前的位置。它就呆在哪儿,可是
`
const rigidRef = useRef(null); // 玩家所在刚体
const [disable, setDisable] = useState(false);
// 相机移动
function cameraMoveTo(to: Vector3) {
if (!camera) return;
setDisable(true);
new TWEEN.Tween(camera.position, tweenGroup)
.to(
{
x: to.x,
y: to.y,
z: to.z,
},
1800
)
.easing(TWEEN.Easing.Quartic.InOut)
.start()
.onComplete(() => {
setDisable(false);
rigidRef.current!.setTranslation(to, false);
});
}
cameraMoveTo(new Vector3(0.5, 1, 6));
<Ecctrl
// 人物设置
position={startPos}
camInitDir={START_DIR}
maxVelLimit={SPEED} // 人物移动速度
turnVelMultiplier={1}
turnSpeed={100}
name="player"
// 相机设置
camListenerTarget="document"
camCollision={false}
camInitDis={-0.01}
camMinDis={-0.01}
camMaxDis={-0.01}
camLerpMult={1000}
camFollowMult={1000}
camUpLimit={Math.PI / 10}
camLowLimit={-Math.PI / 10}
// 移动设置
mode="CameraBasedMovement"
disableFollowCam={disable}
autoBalance={false}
floatHeight={0}
ref={rigidRef}
/>`
- Dominant language
- TypeScript
- Stars
- 823
- Forks
- 102
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pmndrs/ecctrl
-
Rapier Sleeping Body wake up code misses 1 frame of gravityPossibly taken @OptimusPi claimed this 8 days ago. Open
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
errorOpen
Difficulty 4/5 3-5 days Newbie friendliness 15/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 48/100
-
React 19May be free again A pull request for this issue was closed without being merged. Open
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Similar issues
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 82/100
lingdojo/kana-dojo#34714 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 70/100
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
manaflow-ai/cmux#59692 ·
Maintainers usually reply within 1 day
-
Retire stale Python-parity labels in Rust ingress and auth testsPossibly taken @github-actions claimed this today. Openfactory factory:building factory:unowned ralph-status:in-progress via:opencode-free/hy4-flash-free
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
JoshCLWren/comic-pile#5874 · 2 comments ·
Maintainers usually reply within 1 day
-
area: community lane: free-agent priority: P1 roadmap type: task
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
velella-sh/offing#1046 ·
Maintainers usually reply within 1 day