Hey everyone, wanted to get some insight here about how to make the tracker mentioned in the title. What I have so far is that the tracker knows if it’s tracked objective is on screen or not. If the objective is on screen, the UI widget will just become a regular marker icon and it will sit on the location of that objective, otherwise it is just an arrow that I want to use to point to objectives which are off screen.
The part that I haven’t found much information is on how to make the widget rotate around the screen, pointing in different directions along the edges of the viewport to the objective depending on where the Player is. It is important to note that my game is top-down.
Yea something like this just with rotation if possible. Given that I want to use an arrow or something similar, the tip of it should point to the edge always. If this isn’t possible then yea I’d probably try something like this and improvise a bit.
Another, slightly different example:
Perhaps you can then combine both.
And if that’s not enough - the
keywords you’re looking for are:
screen edge indicator
Combination of these two would be exactly what I hoped for! Thanks again for helping me, I was googling ‘objective marker’ , ‘quest marker’ ecc… and found not really clear tutorials. I’ll give this a shot now, thanks again!
So if anyone encounters this problem, here is the quick rundown on how to do it. @Everynone has provided the two links above, just use the code from the blueprints he provided, you can literally copy everything. Make sure you set up who is tracking and what is getting tracked, don’t just leave it as is in the blueprint, depends on what you personally want here.
It’s very quick to set up and easily solves the huge problem I had because I didn’t know what to look for. Note that you will need to change the +/- 90 in one of the BPs depending on if your marker image in the UMG is facing up or down.
Here is code that I found regarding if you want to check if an actor is on screen (in the viewport):
This isn’t the best solution, if you want the true true way you will have to do more than this (do some kind of box around your entire actor and then check each box point). For me this one works.
Another tip: try to lessen the load on the Tick function as much as you can. What I did was only use tick if I need to track something off screen. For actors on screen, I just set up a different image for the tracker and just left it as is.
Note also that a lot of posts I saw for this were for FPS and TPS. I am here to say that it works perfectly for top down as well! Again cheers to @Everynone for helping!