TutorialHookPlayer. Delete everything unused (voids and using statements). The script should look like the following:
usingstatements for Game Creator Character and Hooks:
Hookscome 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.
HookPlayercomponent 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:
IHookallows us to access the gameobject too. This is the same as when referencing the player by a public gameobject.
gameobjectfield for accessing a component. Using
HookPlayer.Instanceis enough. Accessing every other component is the same process as with
PlayerCharacter, just replace with what you are searching for and everything is good.