Trying to update instancedMesh count value but nothing happens. #1576
Unanswered
benjamin-krummel-by
asked this question in
Q&A
Replies: 1 comment
-
the code above return is a side effect, you cant run that in the render function, nor is mesh.current known at that time. this is what useEffect is for. |
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 am trying to create a new instancedMesh so that it would have dynamic values for how many instances it has in it. I am getting the count of instances contained after I make a web request so when the page initially loads it has no idea of how many instances it would need to render.
This is the function that is returning the instancedMesh. I can see the code hitting this one a second time to return another instanced mesh but it doesn't get rendered. Is there an easy way to dynamically change the count on the instanced mesh. I read a couple of older posts saying that you have to create a new one if you want to change the count but that doesn't seem to be working in my case. Any suggestions/help would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions