I wonder - how I can achieve the same effect of 2d box around objects?
I understand that we probably need to calculate the bounds of the object we looking at with camera perspective in mind, then somehow make this calculations to be in 2D Space and screen space, and then transfer this calculations to Widget but this is where my ideas end and I don’t really know where to start.
I found this discussion where this node is also used. It seems to work, but only on 1 side of the 3D Space Box - like it doesn’t get the side of 3D Box closest to the camera. Video how it works now - you can see this clearly on a chimney door.
Edit: Managed to fix that - i don’t know why but I set the BoxEnd X and Y values to BoxStart X and Y values. I will now put the arrows images on the corners and post the result, if it even works.
So - If anyone want to make this here is a simple corner image if u want to use it for testing
In a Widget Blueprint you need to create 4 canvas (im not sure about using a lot of canvas for performence reason but it should not be expensive) and put corner images in them, you also need to rotate the images depending on corner where they will be placed.
Then you just need to pass Object Origin and Object Extend to this Widget Blueprint.
I do this from BP_FirstPersonCharacter because there I check on what is Player looking at.
Here is example:
Remember to create missing variables in your Widget Blueprint!
I’m really sorry, but another problem has arisen… well, this feature seems to be really expensive: extra 8 ms, and I can really feel this in-game - is there anything that can be done to improve this? My guess is that it is due to For Loop?
Again - I’m really sorry for spam, I will think twice next time before posting, I minimalized it to ~2 ms by just storing variables such us Get Player Controller in constructor. Also in Set Image On Corners event you can store the Slot as Canvas Slot as variable too and It gives good FPS boost.
The loop that i was writing about is on this event tick in widget blueprint. Actually theres two For Each Loop. Any help for making latency even smaller is welcome!