Programming/Unreal
unreal-visual-studio-debugging
BaeMinCheon
2019. 6. 30. 23:39
unreal-visual-studio-debugging
- this post covers
- how to debug unreal project using visual studio IDE
- environment
- Windows / 10
- Unreal Engine / 4.21.2
- Visual Studio / 2015 Professional
pre-task
- finish the tutorial of the document
- now you get the floating object with simple cpp codes
start-new-instance
- open the visual studio project of the unreal project
- close the unreal editor
- right click the game project and select "Debug/Start new instance"
- be careful whether the project you selected is the game project or the engine project
- now your visual studio entering in debug mode
- and new unreal editor instance is created
- this editor instance is linked with current debugging session
using-breakpoint
- play the game in the unreal editor
- the actor you made would be floating
- add a breakpoint in "AFloatingActor::Tick()"
- because the "Tick()" function is called each game loop, we should meet the breakpoint
- yeap, we have just met the breakpoint
- then you can look up the local variable
- perfect, they are the same value
- you can debug the unreal project like this way
caution
- the constructor is not actually called when the instance of the class is created
- so wanting stop the program exactly when the instance of the class is created, you should add a breakpoint in "BeginPlay()"