}
I had a basic knowledge of C (for use with programming microcontrollers) prior to starting this course and my understanding was that after a function is called, it moves on sequentially to the next function in the main (in this case the BeginPlay) and once finished, it exits the function. Because of this, I would like to know why we can continuously press LShift and RMB to “grab” even though the begin play function is only called once when the game is started.
Because SetupInputComponent() isn’t what’s calling the Grab function it only sets up the input component. It’s simply binding those mappings so it knows what functions to call when certain input events happens. It would be like a setter function rather than doing any of the event logic.