I kept getting object exception error whenever i made a call to worldVertices. I changed the code by adding one parameter to the function and it seemed to fix it but im not sure if its the correct way to do it.

I kept getting object exception error whenever i made a call to worldVertices. I changed the code by adding one parameter to the function and it seemed to fix it but im not sure if its the correct way to do it.

Is your shape attached to a rigid body? If not, you should do it like so: