I’m following Penelope’s tutorial to learn more about character control in mobile devices (just finished Lerpz tutorial - yay!). I guess I made a small mistake, but can’t find where.
I made everything step-by-step up to page 41. My CameraRelativeControl.js script works until I add this function:
function _FaceMovementDirection() {
var horizontalVelocity : Vector3 = character.velocity;
horizontalVelocity.y = 0;
if (horizontalVelocity.magnitude > 0.1) {
thisTransform.forward = horizontalVelocity.normalized;
}
}
I have no clue why setting “forward” makes my StandIn fly (it always goes up, never goes down). I put Debug.Log everywhere and anything looks fine (with y=0).