My Character wont move


I posted once too but you said i should copy and paste the whole code.
I hope you can help me (again) :smiley:

It looks like the forum software didn’t include your code :confused:

Sorry about that, it can be picky. Can you try again, either with copy & paste or by using the Share link in 3DE as described in this welcome post?

I’m very happy to help, so please give it another try and I’ll answer as quickly as I can!

-Chris

Here’s the link to my game, i pressed Share and then i got this url:
https://is.gd/kKgYC7

Thanks, I can see the code now.

The main problem here is that the code is missing some of the work from chapter 3. Specifically, it is missing the code to animate the scene. After chapter 3, the following code should come below the code that creates the leftFoot and adds it to the avatar:


  // Now, animate what the camera sees on the screen:
 var isCartwheeling = false;
 var isFlipping = false;
 function animate() {
   requestAnimationFrame(animate);
   if (isCartwheeling) {
     avatar.rotation.z = avatar.rotation.z + 0.05;
   }
   if (isFlipping) {
     avatar.rotation.x = avatar.rotation.x + 0.05;
   }
   renderer.render(scene, camera);
 }
 animate();

If you add that into your code, it should work BUT…

There is now a bug inside the sendKeyDown() function. I think you were probably trying to problem-solve by trying different things. That’s normally an excellent way to solve problems, but in this case, it has come back to haunt you. I think you can probably figure out the problem inside sendKeyDown() yourself, so I won’t give you the answer… yet :slight_smile:

But if you can’t find the problem, don’t worry. Just ask and I’ll tell. Sometimes it’s super hard to see a problem in code after you have been working on it for a long time – so don’t be afraid to ask if you can’t find it!

-Chris