Помогите пожалуйста, это мой первый код(C#) и игра, можете исправить чтобы было все правильно. Ошибка :
Assets\Scripts\PlayerController.cs(77,23): error CS1061: 'Transform' does not contain a definition for 'culerAngles' and no accessible extension method 'culerAngles' accepting a first argument of type 'Transform' could be found (are you missing a using directive or an assembly reference?)
Код:
using System.Collections; using System.Collections.Generic; using UnityEngine;
public class PlayerController : MonoBehaviour { public float speed; public float JumpForce; private float MoveInput;
Парень, если английский не знаешь, то пользуйся переводчиком. У тебя ошибка элементарная, а ты сразу задавать вопросы на форуме, даже 5 минут не подумав как её решить
Ошибка :
Assets\Scripts\PlayerController.cs(77,23): error CS1061: 'Transform' does not contain a definition for 'culerAngles' and no accessible extension method 'culerAngles' accepting a first argument of type 'Transform' could be found (are you missing a using directive or an assembly reference?)
Код:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerController : MonoBehaviour
{
public float speed;
public float JumpForce;
private float MoveInput;
private bool facingRight = true;
private Rigidbody2D rb;
private bool isGrounded;
public Transform feetPos;
public float CheckRadius;
public LayerMask whatIsGround;
private Animator anim;
private void Start()
{
anim = GetComponent<Animator>();
rb = GetComponent<Rigidbody2D>();
}
private void FixedUpdate()
{
MoveInput = Input.GetAxis("Horizontal");
rb.velocity = new Vector2(MoveInput * speed, rb.velocity.y);
if(facingRight == false && MoveInput > 0)
{
Flip();
}
else if(facingRight == true && MoveInput < 0)
{
Flip();
}
if(MoveInput == 0)
{
anim.SetBool("isRunning", false);
}
else
{
anim.SetBool("isRunning", true);
}
}
private void Update()
{
isGrounded = Physics2D.OverlapCircle(feetPos.position, CheckRadius, whatIsGround);
if (isGrounded == true && Input.GetKeyDown( KeyCode.Space ))
{
rb.velocity = Vector2.up * JumpForce;
anim.SetTrigger("takeOf");
}
if(isGrounded == true)
{
anim.SetBool("isJumping", false);
}
else
{
anim.SetBool("isJumping", true);
}
}
void Flip()
{
facingRight = !facingRight;
Vector3 Scaler = transform.localScale;
Scaler.x *= -1;
transform.localScale = Scaler;
if (MoveInput < 0)
{
transform.culerAngles = new Vector3(0, 180, 0);
}
else if (MoveInput > 0)
{
transform.culerAngles = new Vector3(0, 0, 0);
}
}
}