Unity Ninja Unity 3D Forum
To have exclusive access to all downloads, recourses and links within this forum, a free registered account is required. Just a heads up Wink
Share
Go down
Member [Lv. 0]
Member [Lv. 0]
Posts : 1
Points : 1127
Rep : 0
Join date : 2015-07-21
View user profile

error CS1525: Unexpected symbol `float'

on Tue Jul 21, 2015 2:17 am
I don't know what I did wrong.

// Update is called once per frame private void Update() { GetUserInput ();
    if (!_motor.canControl)
    {
        _motor.canControl = true;
    }

    moveDir = new Vector3 (Input.GetAxis (PlayerInput.Horizontal), 0f, Input.GetAxis(PlayerInput.Vertical));

    if(moveDir.sqrMagnitude > 1f) moveDir = moveDir.normalized;

    _motor.inputMoveDirection = _playerTransform.TransformDirection(moveDir);
    _motor.inputJump = Input.GetButtonDown(PlayerInput.Jump);

    _motor.movement.maxForwardSpeed = (walk) ? WalkSpeed : runSpeed;
    _motor.movement.maxBackwardsSpeed = _motor.movement.maxForwardSpeed;
    _motor.movement.maxSidewaysSpeed = (walk) ? walkStrafeSpeed : runStrafeSpeed;

    if(moveDir != Vector3.zero) idleTimer = 0f;

    inAir = !_motor.grounded;
    grounded = !inAir;

    float currentAngle    = _playerTransform.localRotation.eulerAngles.y;
    float delta = Mathf.Repeat((targetYRotation - currentAngle), 360f);

    if(delta > 180f)delta -= 360f

    float newYRot = Mathf.MoveTowards(currentAngle, currentAngle + delta, Time.deltaTime * maxRotationSpeed);
    Vector3 newLocalRot = new Vector3(_playerTransform.localRotation.eulerAngles.x, newYRot, _playerTransform.localRotation.eulerAngles.z);
    _playerTransform.localRotation = Quaternion.Euler(newLocalRot);
}
#endregion
Back to top
Permissions in this forum:
You cannot reply to topics in this forum