Possible Bug in SkinnedMeshRenderer TS

Hello, I am not sure if this is the best place to report this, but I think there is a problem in the Typescript SkinnedMeshRenderer definition.
When you have a SkinnedMeshRenderer in the scene, you have access in the Inspector to MeshRenderer properties, like materials and mesh.
But when you try to access this through code, all you have access is this:


Also if you try to cast from one type to another, isn’t possible, because it is considered a error, like this:
let testCast: cc.MeshRenderer = skinnedMesh as cc.MeshRenderer;

And lastly, in this following example, the getComponent SkinnedMeshRenderer is considered a error, saying SkinnedMeshRenderer don’t implement cc.Component:

let getSkinned: cc.SkinnedMeshRenderer = myNode.getComponent(cc.SkinnedMeshRenderer);
let getMesh: cc.MeshRenderer = myNode.getComponent(cc.MeshRenderer);

And the MeshRenderer works fine. Also, everything here only apply to Typescript (I did a workaround for my need using a Javascript module to do the getComponent(cc.SkinnedMeshRenderer(, so it is probably something with the d.ts definition from the engine.

Thanks

Thanks, it will be fixed in next version

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.