I've been trying to register to "StartGameBehaviour.OnStartGame" to detect whenever the game starts. Reason being I want to add a component to the player and the player's camera. However, this event seems to never trigger. Is OnStartGame only for starting a new game? O_O
Thanks,
Josh
Code Question: Game Start Event
- joshcamas
- Posts: 87
- Joined: Mon Sep 21, 2020 7:01 am
- Ralzar
- Posts: 2211
- Joined: Mon Oct 07, 2019 4:11 pm
- Location: Norway
Re: Code Question: Game Start Event
You have to register a method to the event.
StartGameBehaviour.OnStartGame += MyMethod();
MyMethod()
{
code
}
StartGameBehaviour.OnStartGame += MyMethod();
MyMethod()
{
code
}
- joshcamas
- Posts: 87
- Joined: Mon Sep 21, 2020 7:01 am
Re: Code Question: Game Start Event
Yes indeed, that is what I've been doing, but it doesn't trigger... :S
- Ralzar
- Posts: 2211
- Joined: Mon Oct 07, 2019 4:11 pm
- Location: Norway
Re: Code Question: Game Start Event
Wait, when are you trying to have this trigger? I'm pretty sure OnStartGame is for when you start a new game. So not if you load a save.
- joshcamas
- Posts: 87
- Joined: Mon Sep 21, 2020 7:01 am
Re: Code Question: Game Start Event
Ahhh that explains it! I'll look for a load event then