Change the crosshair dynamically in the first person template
I'm trying to change the crosshair dynamically in the first person template. The idea is to change the crosshair when targeting an item or hide the crosshair when going into iron sights. I'm using the following as a test:
The problem is that the if statement is working and I would think that it would set the CrosshairTextObj to "/game/firstperson/textures/hand" but it falls back on the else statement for some reason and I have no idea why.
Is my approach to dynamically changing the crosshair wrong? What's the best way to do this in C++?
asked Dec 27 '17 at 08:49 PM in C++ Programming
Hey there, you are doing that initialization on the constructor and probably when he's executing that, the player hasn't been assigned with a character yet. You need to have 2 different variables for the crosshair and for the hand and on the DrawHUD function you do the cast and decide which texture to use.
answered Dec 28 '17 at 10:47 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here