Why not put code for world projected mouse cursor in player controller?
A new project created from the top down template for mobile includes some boilerplate code for some of the basic set up of a character. But in this template, the green decal that shows the mouse cursor location in the world (projected into the world through GetHitResultUnderCursor(ECC_Visibility, true, TraceHitResult)) is declared, created and updated not in the player controller or the HUD but in the default character .h and .cpp files.
So when I created my own character class I moved the code to the player controller since it is part of the player control interface. However, when I did this, the cursor stopped appearing in game. In fact, through logs I can show that it is being created, the decal material is being applied, and it is being moved to the correct location. However, no matter how I set visibility or IsHiddenInGame, it doesn't show up.
So there must have been a reason why the programmer at Epic who created the top down mobile C++ template put this chunk of code on the character instead of the player controller. I'm wondering if there is just some rule against the player controller directly spawning something in the world, or something like that.
asked May 24 '18 at 06:43 AM in C++ Programming
Follow this question
Once you sign in you will be able to subscribe for any updates here