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

You are not connected. Please login or register

Unity Ninja Unity 3D Forum » General Dicussions » error CS1525: Unexpected symbol `float'

error CS1525: Unexpected symbol `float'

View previous topic View next topic Go down  Message [Page 1 of 1]

1 error CS1525: Unexpected symbol `float' on Tue Jul 21, 2015 2:17 am


Member [Lv. 0]
Member [Lv. 0]
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);

View user profile

View previous topic View next topic Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum