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

Reset of target on rerender #46

Open
Valentin-Rault opened this issue May 10, 2024 · 0 comments
Open

Reset of target on rerender #46

Valentin-Rault opened this issue May 10, 2024 · 0 comments

Comments

@Valentin-Rault
Copy link

I am using the orbit control in my app and I have a gesture detector wrapped around it to detect tap gestures to add points onto an avatar.
When setting my location based on the value of the tap gesture, I trigger a rerender by storing the selected vector in a state. This causes the scope.target to be reset to a new Vector3. Therefore the camera jumps back to position (0, 0, 0) if I had done a pan gesture prior to it.

I am not sure of the extends of changing this behavior, but storing the target as a ref seems to be solving my issue without creating any unwanted behaviour

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

1 participant