Cs0117 unity ошибка

Вот код

Пожалуйста, помогите исправить ошибку

Assetsscript2.cs(11,19): error CS0117: ‘Input’ does not contain a
definition for ‘Getkey’

в коде, который на картинке.

alexsteeel's user avatar

alexsteeel

5612 серебряных знака10 бронзовых знаков

задан 11 дек 2021 в 17:35

Максим Сучков's user avatar

3

Все очень просто: GetKey — функция состоящая из 2х слов, каждое слово в функции пишется с большой буквы.

ответ дан 12 дек 2021 в 8:04

GetKey пишется с двумя большими буквами, поэтому и ошибка

ответ дан 13 дек 2021 в 0:34

YuraSuper2048's user avatar

Обе ошибки из-за того, что у вас нету нормальной ссылки на камеру. В первом случае вы подсунули newcam, что совпадает с названием вашего класса, а посему компилятор пытается интерпретировать это как вызов статического метода. Во втором случае вызов метода у camera не срабатывает, потому что вы взяли туториал трёхгодичной давности, а Component.camera уже давным-давно выпилили. Решить это всё можно двумя способами: обращаться к камере через Camera.main, либо сделать публичное поле и в инспекторе перетащить туда камеру.

Пригласить эксперта

1) У newcam нет метода WorldTo…. Какой вообще это тип данных?
2) Не найдена перегрузка с нужными параметрами для VIewportTOWorldPoint. Параметры не те в функцию переданы короч.

Судя по вопросу — вы новчиек в программировании. Поэтому — сначала научитесь программировать, а потом суйтесь в юнити.


  • Показать ещё
    Загружается…

04 июн. 2023, в 01:35

1500 руб./за проект

04 июн. 2023, в 01:25

40000 руб./за проект

03 июн. 2023, в 23:42

1500 руб./за проект

Минуточку внимания

Last Updated on June 4, 2022

Vrchat SDK error cs0117 is a common issue you may come across when using the SDK.

Continue reading to learn how to solve it easily.

Close Unity and delete any SDK-related folders and their meta files according to the SDK removal instructions.

Under Player > Other Settings, look for Scripting Define Symbols in your Project Settings.

Remove any symbols that aren’t related to the SDK you used to create your project. Remove UDON and VRC SDK3 from applications created with SDK2. VRC SDK2 should be removed from SDK3 projects. The symbols are separated by a semicolon (;). After that, hit Enter to save your changes.

Add the appropriate SDK to the project.

What Is the VRChat SDK and How Does It Work?

The Software Development Kit is what the SDK in the VRChat SDK stands for. And, as the name implies, in an app that was created specifically for the VRChat platform to allow users to build their own avatars, interactive worlds, and other content.

VRChat runs on the Unity 3D game engine, which means that practically all of Unity’s capabilities, such as lighting, navigation mesh, and animations, function effortlessly in VRChat.

The VRChat SDK is available in three distinct versions. The VRChat SDK3 – Avatars is perhaps the most popular. This may be used to make VRChat Avatar 3.0 avatars. This allows you to establish one or more distinct identities for the VRChat platform.

VRChat SDK-created avatars provide unrivaled personalization, facial and bodily expression, and control.

There’s also the VRChat SDK3 – World app, which allows you to develop whole new and fascinating gaming worlds. You may create a variety of relaxed hangout areas and clubs for you and your virtual avatar buddies to meet up and have a good time. You may also make virtual games.

There’s VRChat SDK2. This isn’t as up to date as the VRChat SDK3 applications, and it’s only for supporting old content.

Can I execute “Deletion Reinstalls” for SDK3-Avatars?

State behaviors will be lost if you delete the SDK directories while Unity is closed and then open Unity without the SDK loaded. They’re frail, and they don’t persist through full elimination upgrades. Make regular backups of your work and save/document your state-behavior configurations.

If you need to reinstall your SDK3-Avatars package from scratch, make a backup of your project first. You’ll have to re-create your state behaviors, so make sure they’re carefully documented.

How To Set Up The VRChat SDK

Please keep in mind that the instructions for installing VRChat SDK assume that you are running the essential programs on a Windows PC and not on any other operating system.

Before you get started, the first thing you should do is double-check that you’re using the right Unity version.

However, you should check the VRChat website’s Guides section to see which version is the proper one in case it changes. Please keep in mind that if you want to create content for VRChat on Oculus Quest at this time, you’ll need to configure your Unity app correctly. 

Make a project

You’ll need to launch Unity Hub, select Create a new project, and set it to 3D at this stage.

After that, you’re free to start working on your first project. However, as a heads-up, Unity files may be rather enormous, so make sure you save all of your projects to a mass storage system with plenty of capacity.

It’s a good idea to start a new project for each new planet you discover. However, with avatars, this is less of an issue, and it will be completely OK to maintain your multiple avatars in distinct scenes within the same project.

After you’ve opened the project, make sure the title bar ends in PC, Mac, and Linux Standalone DX11>. If it doesn’t, something needs to be done about it.

Install the SDK

Now, open Explorer and double-click on the SDK’s Unity package to open it, with Unity open to your project.

It’s also possible to import it via Assets > Import Package > Custom Package.

Please make sure you’re using the correct SDK.When the import is finished, examine the console window to see if there are any issues that need to be fixed. (There should be no issues unless you downloaded the wrong version of Unity.)

Login

To utilize the SDK, you must first log in with your VRChat information. You’ll need to go to VRChat SDK > Show Control Panel > Authentication to achieve this.

Unfortunately, you cannot upload content using your Steam, Oculus, or Viveport accounts. You’ll also need a VRChat account with at least a New User Trust Rank.

But don’t worry, increasing your trust rank is simple; all you have to do is play VRChat, explore places, and meet new people.

I’m pretty new to Unity, and recently I’ve begun working on my first mobile game using C#, and suddenly I get the CS0117 error and I don’t know why since my code is pretty simple and the console won’t specify in which line the error occurs. I received the error when I wrote the simple line:

transform.position = new Vector3 (0, 0, 0);  

in my player script to set it’s position to the same as the position of the camera. I don’t think that this has anything to do with the script itself, but that it is a problem with my phone, but I don’t know what the problem is.

In case you need it, here are the full scripts of the player and the camera.

player script:

public class playerScript : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        transform.position = new Vector3 (0, 0, 0);
    }

    // Update is called once per frame
    void Update()
    {
        //movement
        if (Input.touchCount > 0)
        {
            Touch touch = Input.GetTouch(0);
            Vector3 touchPosition = Camera.main.ScreenToWorldPoint(touch.position);
            touchPosition.z = 0f;
            transform.position = touchPosition;
        }

        //borders
        if (transform.position.x >= 2.3f)
        {
            transform.position = new Vector3(2.3f ,transform.position.y, 0);
        }
        if (transform.position.x <= -2.3f)
        {
            transform.position = new Vector3(-2.3f ,transform.position.y, 0);   
        }
        if (transform.position.y >= 4.5f)
        {
            transform.position = new Vector3(transform.position.x, 4.5f, 0);
        } 
        if (transform.position.y <= -4.5f)
        {
            transform.position = new Vector3(transform.position.x, -4.5f, 0);
        }
    }
}

Camera script:

    public class cameraScript : MonoBehaviour
{
    // Start is called before the first frame update
    void Start()
    {
        transform.position = new Vector3 (0, 0, 0);
    }

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and
privacy statement. We’ll occasionally send you account related emails.

Already on GitHub?
Sign in
to your account

Comments

@GeorgeDominic

I am upgrading from Google Play Services from v 0.9.01 to 0.9.20 in unity 4.5, but I am getting this error Assets/GooglePlayGames/Editor/GPGSPostBuild.cs(41,39): error CS0117: UnityEditor.BuildTarget' does not contain a definition foriOS’

I am developing for android not IOS, any idea how to fix this?

@GeorgeDominic

I solved this problem by installing the latest Unity3d. But still unable to get the google play services setup on the main menu of the editor.

@claywilkinson

After you updated, can you remove the GooglePlayGames folder in the Assets folder, and reimport the package? The menus should be under Windows/Google Play Games. (We moved them recently to be a better citizen of the Unity editor). If they don’t show up, there must be still some errors in the console?

@GeorgeDominic

yes found it, it is under Windows/Google Play Games. I did not delete the GooglePlayGames folder. using the 0.9.20 version as it is. I deleted the old version 0.9.01 completely with all its files and folders before importing the new one. Thanks claywilkinson :)

@claywilkinson

@CYFERIOUS

well google play games for pc? i have tried because i have the same issue but:

error CS0117: ‘BuildTarget’ does not contain a definition for ‘GameCoreXboxSeries’

but i dont have that windows/googlePlayGames folder.

appreciate your help.

@BUCH696

У меня тожа такая ошибка
ошибка CS0117: «buildTarget» не содержит определения для «GameCoreXboxSeries»
Сейчас пробую обновить до новой версии, может поможет.
Если кто-то знает решение напишите пожалуйста!

@BUCH696

Решил вопрос.
Установил новую версию Unity запустил проект на ней
:)

Понравилась статья? Поделить с друзьями:
  • Cs money 404 ошибка
  • Cs go assert ошибка при запуске
  • Cs go 5v5 eu произошла ошибка
  • Crystaldiskmark ошибка создания файла
  • Crystaldiskinfo частота ошибок чтения 100