get ref externally, or object position from another component. #2282
Unanswered
EightArmsWebmaster
asked this question in
Q&A
Replies: 1 comment
-
Did you deal with it? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have an Character who runs forwards past Walls with a Camera rig following them:
The Character component is inside the dolly component, and the camera position moves forwards:
The issue I have is that sometimes the camera passes through walls, or the walls end up between the camera and character. I'd like to fade out each wall as the camera gets too close to them.
So I'd like to change this function:
To include something like:
But as far as I can tell there is no way to access the camera from the wall component.
I have purposely used the Zustand state to control the camera speed, not the position, as I don't want to update it every frame.
Am I missing a trick for how to let these components communicate between each other?
Beta Was this translation helpful? Give feedback.
All reactions