Download

How to change the crosshair for a top down?

Hi guys, I’m working on a top down shooter, where the character moves around with WASD controls and shooting is controlled by the mouse.
I enabled the “Show crosshair” on MyController blueprint, under mouse settings, and now I’m trying to change the standard crosshair with a new custom one, made by me.
I searched around some guide, but I can’t understand where I should make the blueprint: I already have a HUD blueprint, this one:

3bbc3d4e2e0d0ab1d8ba4aec453483532456e590.jpeg

I go the graph editor and search for the “Receive Draw HUD” but I can’t find it, neither with the context sensitive disabled. So What should I do?
I followed step by step the Twin Stick shooter tutorials from the UE4 you tube channel, I just made some changes around (but not to the hud)…
This is the HUD tutorial, I have the exactly same as him: https://www.youtube.com/watch?v=Wwa0zwkYUeQ&list=PLZlv_N0_O1gb5sdygbSiEU7hb0eomNLdq&index=21

up
Haven’t found a solution yet

Cursors are set in playerController blueprint. Make your own player controller, set it in game mode. And there will be cursor property.
However i do not know how to add or replace one of default cursors with my custom, at least not trought player controller.

Instead i added 3d widget to my player pawn. And on event tick i set its position to “mouse hit under cursor”.
Then i render that 3d widget in screen space (not world space) this makes it look like usual hud cursor.
A bit of workaround but it works. And it is very accurate.

uhmm sorry but I’m quite a newbie, I didn’t understand what actually does your blueprint… would you please post a screen of the result on the viewport?

My cursor BP is a bit more complicated that one described above. I calculate mouse pointer trace from camera to horizontal plane at [0,0,0], and use that as location of cursor.
Also cursor has additional code to detect enemies, range visibility etc, cannot separate it now and i do not have backup with first simple version of it. On top of it all i use components, interfaces, and i am in middle of coding that all for multiplayer. So pictures will do not help.

Instead i try to describe that cursor thing in simple steps:

  • create additional component in your player pawn blueprint, best for this would be “Arrow component”
  • on top of that arrow (in hierarchy list) place “widget component” (it will say its experimental)
  • create new simple UMG widget, as its picture add your cursor material. set anchors to centered, and x: 0.5 y:05 so cursor picture is centered exactly over anchor.
  • apply that new cursor widget to experimental widget in pawn blueprint
  • now in player pawn “event tick” event find location of mouse cursor in 3d and set arrow component location to same as cursor location. Your widget cursor should follow mouse.
  • last thins is setting experimantal 3d widget to be rendered in screen space, so its on top of all geometry.

uhm I meant a screen of the game, just to see what is the final result, but i will try to rebuild the bp following your steps, thank you!
Anyway, today I found this videotutorial: https://www.youtube.com/watch?v=_JI6MkWiI94
I tried to replicate it in both my project and in the thirdperson template, but doesn’t work in any case. I’m missing something…

You can change the default cursor / crosshair in the TopDownCharacter Blueprint. Under components in the top left (the hierarchie) you will see an object CursorToWorld. This is the default cursor and it has a material assigned to it (M_Cursor_Decal) where you can change color, etc… or you could possibly replace it with another image / component. I only wanted to change the color so I’m posting this here for other people trying to change the color.