TutorialHookPlayer
. Delete everything unused (voids and using statements). The script should look like the following: using
statements for Game Creator Character and Hooks: Hooks
come into the game. As stated in the Game Creator documentation: Hooks are Unity components that allow you to easily access unique objects such as the Player or the Main Camera. Their use is not required but useful if you want to simplify the process of selecting common objects.
HookPlayer
component on it. This is done by default when adding a player to your scene, we just make sure it is there. IHook
, this is different than referencing the player gameobject. I agree with you, but to change it, we only need to do this: IHook
allows us to access the gameobject too. This is the same as when referencing the player by a public gameobject. gameobject
field for accessing a component. Using HookPlayer.Instance
is enough. Accessing every other component is the same process as with PlayerCharacter
, just replace with what you are searching for and everything is good.