-
Notifications
You must be signed in to change notification settings - Fork 35
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
Use random seed #971
Use random seed #971
Conversation
issue: on first load, some random clones do not adhere to seed, but subsequent loads do. causes: i thought it might be race conditions that the seed hadn't been set before the clones started generated on first load, so I attempted to fix that but didn't see improvement: c500b4b potential workaround: perhaps I can set seed value when instantiating the component from managed-street, although in a perfect world that wouldn't be necessary screenshots: load 1 (instantiated from streetmix -> managed street add layer button): |
also: pedestrian placement doesn't respect seed yet |
The update function was called two times when creating the scene initially (you could see two floats with the console.log, not sure why) and only once when opening the scene. Just recreate the rng (that's just a function, that cheap) every time you're about to create the entities fixed the issue. I also reversed your logic, just checking things in update. Returning in init is a bit confusing because aframe will still call the update anyway. |
@vincentfretin works great! |
No description provided.