Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialColby Doyle
197 PointsI just wrote up the new code for the camera.. But now when I press play my frog doesnt move anymore And...
And the camera Isnt even on the frog anymore.. I looked at both codes but they look normal.. I dont know how to fix it.
CODE: https://gyazo.com/b41f9d705cc836fdfbf4b6af26b7fd8e
Edit: By Dane E. Parchment Jr. (Moderator)
Colby Doyle
197 PointsDoes anyone know what the problem is?!?!
2 Answers
Randy Eichelberger
445 PointsIt looks like you're missing the code that controls the movement itself. In the if statement on the player script.
volkan Keskin
698 PointsYou are missing the code that does the rotation for the player movement;
......................................
if ( movement != Vector3.zero) {
Quaternion targetRotation = Quaternion.LookRotation(movement, Vector3.up);
Quaternion newRotation = Quaternion.Lerp(playerRigidbody.rotation, targetRotation, turningSpeed * Time.deltaTime);
playerRigidbody.MoveRotation(newRotation);
playerAnimator.SetFloat ("Speed", 3f);
}
................................
Dane Parchment
Treehouse Moderator 11,077 PointsDane Parchment
Treehouse Moderator 11,077 PointsShow us your code so that we can help you debug the problem!