How to extend functions in GameMode class?
Hi! I'm little confused about extending functions. I want to spawn my pawn in nav mesh location so I need to extend RestartPlayer function in MyGameMode. I've put in this in MyGameMode.h
but when I put declartion in cpp file then I'll get all UE_LOG's with error. Also there is "use of undefined type 'APlayerState'" build error. So it dosen't look like this function use GameMode variables. I'm still thinking in US way so I'm surprised that this isn't working :)
I've just started with c++ so can someone show me the way how to do it? Thanks.
If you haven't dont so yet, read this: https://docs.unrealengine.com/latest/INT/Programming/Development/index.html .
Breakpoints are points that you can set at lines of code to tell the debugger to prior to executing this line. Look here and scroll to "Debugging breakpoint" http://www.dotnetperls.com/debugging .
If you say you've done everything correct then I'm not sure where to help : ).
What UE_LOG channel are you using? Since not all are active. I usually use
when I just want to quickly check.
For the specific issue of the UE_LOG errors:
This should resolve the compilation issues, at least those related to logging. This line is copied directly from GameMode.cpp in the engine.
For actually inheriting RestartPlayer, you'll probably want to start with something like this:
The Super:: line is important, as that will execute the existing code in the engine for RestartPlayer. Without that, you'd need to handle getting a StartSpot and possessing a new pawn yourself.
answered Oct 10 '15 at 04:11 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here