Мой код для камеры от третьего лица и движения вызывает ошибку, и я не знаю, почемуC#

Место общения программистов C#
Ответить Пред. темаСлед. тема
Anonymous
 Мой код для камеры от третьего лица и движения вызывает ошибку, и я не знаю, почему

Сообщение Anonymous »


I've recently embarked on the journey of game development and, as i'm sure many have, ran across Brackeys' videos. I watched and did as he said for his "THIRD PERSON MOVEMENT in Unity" video, and I keep getting an error "Assets\ThirdPersonMovement.cs(13,29): error CS1002: ; expected" along with me not being able to move or being able to put the main camera into the reference slot for my script. Here's my code |||| VVVV

using UnityEngine;

public class ThirdPersonMovement : MonoBehaviour {

public CharacterController cc; public Transform cam; public float speed = 6f; public float turnSmoothTime = 0.1f; float turnSmoothVelocity // Update is called once per frame void Update() { float horizontal = Input.GetAxisRaw("Horizontal"); float vertical = Input.GetAxisRaw("Vertical"); Vector3 dir = new Vector3(horizontal, 0f, vertical).normalized; if (dir.magnitude >= 0.1) { float targetAngle = Mathf.Atan2(dir.x, dir.z) * Mathf.Rad2Deg + cam.eulerAngles.y; float.angle = Mathf.SmoothDampAngle(transform.eulerAngles.y, tagrgetAngle, ref turnSmoothVelocity, turnSmoothTime); transform.rotation = Quaternion.Euler(0f, Angle, 0f); Vector3 moveDir = Quaternion.Euler(0f, targetAngle, 0f) * Vector3.forawrd; cc.Move(moveDir.normalized * speed * Time.deltaTime); } } }

I went through the code in his video and other's code in the comments but none of it fixes it.


Источник: https://stackoverflow.com/questions/781 ... nd-idk-why
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение

Вернуться в «C#»