Is there really good documentation on how to add components programmatically? Like where can I find how to add something like a rigid body and collision and control their parameters using Code alone.
This was good https://developer.playcanvas.com/en/tutorials/programmatically-creating/
But it doesn’t include the other API, It would be nice to have something that is pretty well documented.
You’re the best I’ll take a look right away!
Not sure what you mean by ‘other’ API though? Did you mean the data part that you need to pass? In which case, it is the properties of the component that you want to add.
Yeah I think what you sent is all I need for now. Do you have examples to find materials that were made in the engine.
For instance, I want to add a ‘myRed_mat’ material I made to an entity that was created via through code.
I’ve made a start on improving this:
I now need to document the
data object for each component. I’ll put that in the overview for each component page I think.
Great! not sure what i’m reading though lol sorry i’m pretty noob.
It’s OK - this topic is never explicitly covered in the API reference manual and I’m glad you raised the issue. I’ll try to improve this in the coming days.
Awesome! Link it as soon as you do! Also what yaustar sent is good for me now
Not sure how I’d go about adding a script through code, any help here?