nunuStudio icon indicating copy to clipboard operation
nunuStudio copied to clipboard

trouble accessing cannon functions from withing code editor

Open KCGD opened this issue 3 years ago • 2 comments

Sorry to be a bother about this, im trying to access the the cannon hightfield function but i cant get anything out of cannon, ive tried to just console logging cannon to get all the functions in it but it just returns {"version":"0.6.2"} and nothing else, how can i access it?

this is on the windows version (0.9.6)

Thanks for being supportive with all this

KCGD avatar Jul 23 '20 21:07 KCGD

Hello

This might be related with the move of the editor to modules. I tried to access CANNON from a script and it seems to work fine:

On the browser console CANNON should not be accessible since it is not exposed globally. I have just exposed THREE globally because some libraries require it.

Capture

Inside of scripts cannon objects should be accessible with or without the CANNON. prefix and should work fine there booth for

Do you require access to cannon somewhere else in the editor?

Thanks a lot!

tentone avatar Jul 23 '20 22:07 tentone

@tentone I was able to access the function but whenever i run it the editor completely freezes (both web and windows version) also there wasn't any errors in the console. I was running the example code in the cannon docs

KCGD avatar Jul 24 '20 04:07 KCGD