F
F
fanot2017-09-18 19:16:20
C++ / C#
fanot, 2017-09-18 19:16:20

Error CS0117. What's wrong?

The following errors occurred: 06fed48e7f1a4bb282e6771717fe98e2.png0aac65b4272f4af495dc52b313009517.png
Old script, taken from this video.
https://www.youtube.com/watch?v=oYaGPeZW8JM

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Daniil Basmanov, 2017-09-19
@fanot

Both errors are due to the fact that you do not have a normal link to the camera. In the first case, you slipped in newcam, which is the same as your class name, and therefore the compiler tries to interpret this as a call to a static method. In the second case, calling the camera method does not work, because you took a three-year-old tutorial, and Component.camera was cut out a long time ago. There are two ways to solve all this: access the camera through Camera.main , or make a public field and drag the camera there in the inspector.

G
GavriKos, 2017-09-18
@GavriKos

1) newcam doesn't have a WorldTo... method. What data type is it anyway?
2) No overload found with required parameters for VIewportTOWorldPoint. Parameters not those in function are transferred in short.
Judging by the question - you are new to programming. Therefore, first learn to program, and then poke your head into the unit.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question