S
S
Sergey Kremov2020-11-05 11:31:49
C++ / C#
Sergey Kremov, 2020-11-05 11:31:49

Error CS1061 and CS0120 unity how to fix the error?

there was a problem with the code, i.e. two errors cs1061 and cs0120
5fa3b6c6cb89e577310807.png
link to the script (because it's too big): https://drive.google.com/file/d/1PBnvty6xHGRpxqsM2...
the code is not mine, I'm just trying it modify
if

public bool LockRotation { get; set; }

        //public bool viewTransform;
        
        private void RotateView()
        {
            if (LockRotation)
            return;

            viewTransform.LookRotation (transform, Camera.transform);
        }

at
//public bool viewTransform;
remove // ​​then there will be only one error when solving which all the same errors appear (see photo above)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
G
GavriKos, 2020-11-05
@GavriKos

1. Read the text of the errors. Try to understand them
2. Read the Unit API
3. Read the SeaSharp tutorial - long and thoughtful
4. Google the error codes themselves - they have little to do with the unit.

A
Alexander, 2020-11-06
@tentrun

You do not have a static field, you were told directly about it. This is the first. The second you are explicitly told that Transform does not contain LookRotation. It and is clear, you cho Boolean variables were going to move? I'm afraid with such knowledge you will only create black holes and we will wallow in a singularity.
public static bool LockRotation { get; set; }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question