You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TypeError: Cannot read property 'random2D' of undefined #42
Hi @mozgbrasil the p5 that gets passed into the module isn't the same as the global p5 you traditionally get with a script tag. To access certain things with this package (due to the p5 node module itself) you need to use p5.constructor.[something], in your case p5.constructor.Vector.random2D() will get you what you need.
Reacted by Joseph Horton
Reacted by Dan Clarke
Reacted by Tô Quang Thắng, Abhinav Desor and Jacob Chappell
Activity
jamesrweb commentedon May 23, 2020
Hi @mozgbrasil the
p5that gets passed into the module isn't the same as the globalp5you traditionally get with a script tag. To access certain things with this package (due to thep5node module itself) you need to usep5.constructor.[something], in your casep5.constructor.Vector.random2D()will get you what you need.jamesrweb commentedon Sep 23, 2020
Closing issue due to inactivity.