InGameMenu Challenge - When to use "this"

I did the challenge almost completely similar but in the Cancel pressed function where you only put Teardown(); I put it under "this->Teardown(); My thought proccess was that this would refer to the ingame menu similar to how we used menu->teardown(); in the game instance cpp.

What is the flaw in my thinking here? Am I not completely understanding how “this” works?

The main difference is tyou could easily create the menu and keep it created and only tear down when the level is navigated away from or 9n exit. This would be more efficient than creating the widget every time you want to show it.

Otherwise it is pretty much the same. To be honest, creating and destroying every time is fine too, only it could be done better.

Privacy & Terms