@super-boy-vasek

Ошибки в скрипте Unity?

using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using UnityEngine;

public class jostik : MonoBehaviour
{

    public jostik Jostik;
    Rigidbody2D rb;
    float run;
    bool jump = true;




    // Start is called before the first frame update
    void Start()
    {
        rb = GetComponent<Rigidbody2D>();  
    }

    // Update is called once per frame
    void Update()
    {

        run = jostik.Horizontal * 5f;

        if(jostik.Vertical >= .5f & jump)
        {
            jump = false;
            rb.velocity = Vector3.zero;
            rb.AddForce(transform.up * 7.5f, ForceMode2D.Impulse);
        }


        //разгон
            rb.velocity = new Vector2(run, rb.velocity.y);
        
            
    }
}
  • Вопрос задан
  • 184 просмотра
Пригласить эксперта
Ответы на вопрос 2
Griboks
@Griboks Куратор тега C#
Возможно, нужно поменять местами слова jostik Jostik;
Ответ написан
HemulGM
@HemulGM
Delphi Developer, сис. админ
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы