Uncaught TypeError: Cannot read property 'x' of undefined


#1

Hi,

I am taking bounding box of a mesh and finding center of each side. So we will have 6 points.
I am trying to add hotspot (a small button when clicked it shows some info) at these 6 points.

I am getting below error

Uncaught TypeError: Cannot read property ‘x’ of undefined
at Function.d.TransformCoordinatesToRef (babylon.js:1)
at _.i.getFacetPositionToRef (babylon.js:1)
at _.i.getFacetPosition (babylon.js:1)
at createHotspot (eval at (index.js:556), :48:21)
at s.eval [as callback] (eval at (index.js:556), :38:13)
at t.notifyObservers (babylon.js:1)
at E._checkIsReady (babylon.js:1)
at babylon.js:1

Please help me.
Thanks in advance.
PG:
https://playground.babylonjs.com/indexStable.html#988YZC#2


#2

Well jsut a quick look but in your createHostspot, the faceId is null meaning that your position parameter is wrong