JohnK Posted January 5, 2017 Share Posted January 5, 2017 Working on the new multi-user challenge using Endel's template and thank you to Endel for helping me use it. To start with I built a single user project locally using Javascript and everything works well. On transferring the code to main.ts in client folder in the template I get the following error for line 94, other lines OK main.ts:94:15 Supplied parameters do not match any signature of call target. code is 92 var subCSG = baseCSG.subtract(drillsCSG); 93 94 holder[i] = subCSG.toMesh("holder" + i, new BABYLON.StandardMaterial("mat", scene), scene); so line 94 works OK in Javascript but not in Typescript - any idea why? Quote Link to comment Share on other sites More sharing options...
Kesshi Posted January 5, 2017 Share Posted January 5, 2017 toMesh expects 4 parameters: https://github.com/BabylonJS/Babylon.js/blob/master/src/Mesh/babylon.csg.ts#L594 so just at a false or true after the scene parameter JohnK 1 Quote Link to comment Share on other sites More sharing options...
JohnK Posted January 5, 2017 Author Share Posted January 5, 2017 @Kesshi thank you. I understand you can get away with in Javascript but because Typescript is strict you need all parameters. Since all the examples I found were in Javascript and didn't have the last parameter I was fooled. Quote Link to comment Share on other sites More sharing options...
Kesshi Posted January 5, 2017 Share Posted January 5, 2017 I don't know which IDE / editor for Typescript you are using but the editor should actually show you the expected parameters + data type for each function. Quote Link to comment Share on other sites More sharing options...
JohnK Posted January 5, 2017 Author Share Posted January 5, 2017 Visual Studio Code and yes it does do as you say. Was just to lazy to read it properly will do so in future. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.