I want to display "test" on the console when I click Plane (2) using Event trigger in unity (c #).The problem i am experiencing
I completed the program and added an Event trigger to Plane (2).
I chose the script from the newly appeared tab.
However, the function could not be displayed where the function was put.
What I tried
When I clicked on the place where it was written as monosucript for trial, a field where new characters can be written
It was displayed, but I could not solve it even if I put a function in it.
The version is from 2019.
Answer # 1
I will answer assuming that the method "is not displayed" has been resolved.
Drag and drop your object from the hierarchy to the target of EventTrigger and select the WASD class Event method.
Strictly speaking, "where to choose the script" in the question is "where to select the target instance".
What an instance is is an "thing" that exists in the scene.
The object you dragged and dropped from the Project panel or selected in the Select Object panel does not yet exist in the scene. "A blueprint for the objects that may be present in the scene and the underlying concept".
On the other hand, if you attach a script to a GameObject, it becomes an "thing" (= instance) that exists in the scene at that time.
For example, if Plane (1) and (2) have WASD scripts respectively,
"Plane (1) WASD" and "Plane (2) WASD" are "separate existence (= different instances)".
As a general rule, the script will not work unless it is an instance.
Since the target specification of EventTrigger is "which instance, which class, which method is called", the method can be correctly specified by specifying "Event method of WASD class of Plane (2) (= instance of self)". Will be called.
* The concept of instance will continue to be essential in the future, so I think it will be easier to develop later if you investigate until you understand it.
- c # - [unity] about the type of function that returns multiple types
- c # - [unity ray cast] execute the function of the object that received the ray
- php - call to undefined function have_posts () is displayed [wordpress]
- [unity] characters are not displayed even though it is hit
- candidates are not displayed even if i hit a period in c # opened in unity
- c # - i want to create a list of toggle in a unity script
- c # - [unity] i want to start the variables of the script of multiple generated objects individually
- c # - in unity, i want to keep the speed of moving objects constant
- c # - [unity] in ios, i want to prevent the game from stopping when the notification center or control center is opened
- c # - unity wall penetration&camera buried
- c # - player production in unity (shooting game)
- c # - i want to get the coordinates on unity (model read from revit)
- i want to reflect the style on the map displayed by google's maps sdk for unity
- c # - no sound in unity games
- c # - i want to specify the event when the enter key is pressed in the textbox in the mvvm of wpf + livet
- c # - i want to get 5 items in unity and display the clear screen
- c # - does the start function of a script that was turned off work when it is turned on again?
- c # - toolbox is not displayed even on the screen of visual studio design
- i want to play unity particles using the onclick function
- c # - unity) firebase db crashes
- python - you may need to restart the kernel to use updated packages error
- php - coincheck api authentication doesn't work
- php - i would like to introduce the coincheck api so that i can make payments with bitcoin on my ec site
- dart - flutter: the instance member'stars' can't be accessed in an initializer error
- [php] i want to get account information using coincheck api
- the emulator process for avd pixel_2_api_29 was killed occurred when the android studio emulator was started, so i would like to
- sh - 'apt-get' is not recognized as an internal or external command, operable program or batch file
- i want to call a child component method from a parent in vuejs
- i want to check the type of a shell script variable