Home>

I will ask you a question here for the first time.
Currently, I am making a 2D game using C # in Unity2017.4.33f1.

When I click on a specific background object, I want to connect the player and the clicked coordinates with an object that has one Hinge joint2D that has been converted to Prehub. What should I do?

I visited various sites and tried it, but it didn't work.
It was fine until the Prehub version appeared, but the place where it appeared was strange, and I didn't even connect with the player in the first place.
There is something missing in the script, and I think the Inspector is set up strangely.

Supplemental information (FW/tool version etc.)

using I'm writing UnityEngine, but I get an error in Camera.main.ScreenPointToRay. What should I do? I checked it but couldn't understand it.

Error

Severity Level Code Description Project File Line Suppressed
Error CS1061 'object' does not contain a definition for 'ScreenPointToRay' and could not find an accessible extension method 'ScreenPointToRay' that accepts the first argument of type 'object'. Check for missing using directives or assembly references.** C: \ **\ Assets \ script \ GameDirector.cs 14 active

  • Answer # 1

    Regarding ScreenPointToRay, the script name was Camera.

Related articles