Hi,
A big bug is appeared after that I only opened my Unity scene.
I’m on the react Setup and, I don’t know why.
After it my component cannot be reached through my scene.
The part of my code in case :
useEffect(()=> {
if(needle) needle.getContext().then((context) => {
const nodeScript = GameObject.getComponentInChildren(context.scene, LoadModelsFromNode)
// console.log(context.scene)
if(nodeScript) {
// We save the script locally
setNode({component: nodeScript})
// We add the settings used to load the models
nodeScript.settings = settings
// We start the loading
nodeScript.loadAll()
nodeScript.historyPromise.then(() => {
// And we set the history load from the script
const actualDate = new Date()
const structuredDate = actualDate.getDay() + "/" + actualDate.getMonth() + "/" + actualDate.getFullYear()
const structuredDateYes = (actualDate.getDay()-1) + "/" + actualDate.getMonth() + "/" + actualDate.getFullYear()
// We place the timestamps
nodeScript.history.map(item => {
if(item.date == structuredDate) item.timestamp = "Aujourd'hui"
else if(item.date == structuredDateYes) item.timestamp = "Hier"
else {item.timestamp = "Précédemment"}
})
setHistory(nodeScript.history)
sendToServer(nodeScript.history)
})
}
})
}, [needle])
I got my context, I got my scene and the Object3D which got the component is in here.
But “nodeScript” is always null, somebody know why ?
by user 224464722878005248