Page 1 of 1

Code Question: Game Start Event

Posted: Mon Sep 21, 2020 7:39 pm
by joshcamas
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

Re: Code Question: Game Start Event

Posted: Mon Sep 21, 2020 7:43 pm
by Ralzar
You have to register a method to the event.

StartGameBehaviour.OnStartGame += MyMethod();

MyMethod()
{
code
}

Re: Code Question: Game Start Event

Posted: Mon Sep 21, 2020 8:10 pm
by joshcamas
Yes indeed, that is what I've been doing, but it doesn't trigger... :S

Re: Code Question: Game Start Event

Posted: Mon Sep 21, 2020 8:16 pm
by Ralzar
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.

Re: Code Question: Game Start Event

Posted: Mon Sep 21, 2020 8:22 pm
by joshcamas
Ahhh that explains it! I'll look for a load event then