Ambiera ForumDiscussions, Help and Support. |
|
|
|||||
|
Hi, I'm trying to load a scene through the following method
however even when I use the latest SDK version of Copperlicht, I receive an undefined error for the engine.load method, and when I log the variable, I only see obfuscated functions like so: http://i.gyazo.com/ea7b2bfc0c39ddc6e3016269778794b6.png Even when I use startCopperlichtFromScene method, and assign this to engine, I get the same error. What do I need to do so I can use the Copperlicht API? |
||||
|
Do you get any error message? |
||||
|
Change the canvas with another name,because you have defined a var with same name.
Try it. ![]() |
||||
|
The error I get is Uncaught TypeError: undefined is not a function main.js:43 In line 43 I have the following code
I've tried with different versions of copperlicht, but I still have the same problem. |
||||
|
Are you maybe using the copperlicht.js file generated by the CopperCube editor? That one doesn't have the .load function, you need the one from the CopperLicht SDK. If this is not the problem, do you know how to add a breakpoint and step through your code? If so, at the place where you call engine.load, is engine an actual object? If not, then this is the problem. Maybe you just forgot to include the copperlicht.js file in your file, or similar. Just wild guessing. |
||||
|
Hi, It started working now, I think the problem was cache even though I tried in a different browser. Thanks for all your help Niko and Skullboy, I'll be sure to pickup a commercial licence ASAP. Btw I would like to ask a question about keyboard inputs - I'm using the default inputs WASD for players to move around using 3rd person camera, however it's interfering with the jQuery , meaning I cannot type WASD inside a text field! Is there a way to disable this through the API? I can't find anything in the docs Cheers |
||||
|
Further to my question above, I also have one more which is puzzling me By default I have a player in the scene named "PlayerMesh" which is the player himself. Now, when I make a clone of this PlayerMesh, using the API, and the following code:
I see two people in the scene which is correct. However when I move my character using the WASD controls, this newly created mesh also moved around - despite the fact that I gave it a different name. What could be the problem? I think maybe I need to change the Id not just the Name, or maybe I'm changing it too late |
||||
|
The reason for this is the following: The player you have has an animator attached to it, which reacts to keyboard input by moving the object it is attached to, namely the player object. When you now clone the player object, you now have a second object which also has a clone of this animator attached to it. And it will do exactly the same. |
|