Hi, I am using CoSpaces with my class to reinforce and extend their JS skills after learning web development. Is there a way for them to add physics to items in the code instead of click each object manually?
Thanks
Hi, I am using CoSpaces with my class to reinforce and extend their JS skills after learning web development. Is there a way for them to add physics to items in the code instead of click each object manually?
Thanks
Hi @Andrew_Worsnop!
Physics related properties of item can be accessed via item.physics
property.
// This is how you can add specific item to physics.
let item = Scene.getItem("Cuboid") as Cuboid;
item.physics.enabled = true
Also there is a global Physics
object, which allows add and remove to physics all items at ones.
Physics.addSceneItems()
Physics.removeSceneItems()
Thanks Ilya! That helps a lot!