Помогите с ошибкой юнити Assets\Scripts\Player.cs(22,67): error CS1513: } expected
12345678910111213141516171819202122232425
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
public float speed;
public float jumpForce;
public Rigidbody2D rb;
private void Update(){
if (Input.GetKey(KeyCode.D)) {
rb.velocity = new Vector2(speed, rb.velocity.y);
}
if (Input.GetKey(KeyCode.A)) {
rb.velocity = new Vector2(-speed, rb.velocity.y);
}
if (input.GetKeyDown(KeyCode.Space)){
rb.AddForce(transform.up * jumpForce), ForceMode2D.Impulse);
}
}
}
По дате
По рейтингу
12345678910111213141516171819202122232425262728
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Player : MonoBehaviour
{
public float speed;
public float jumpForce;
public Rigidbody2D rb;
private void Update()
{
if (Input.GetKey(KeyCode.D))
{
rb.velocity = new Vector2(speed, rb.velocity.y);
}
if (Input.GetKey(KeyCode.A))
{
rb.velocity = new Vector2(-speed, rb.velocity.y);
}
if (Input.GetKeyDown(KeyCode.Space))
{
rb.AddForce(transform.up * jumpForce, ForceMode2D.Impulse);
}
}
}

вот
Больше по теме