How do I display a sector of a circle in decal?

Hi, I’m looking for a way to show an area of effect indicator for skills. The three values I have to display the sector are location (origin of the circle), rotation (facing of indicator), and arc (angle of indicator).

I am using Blueprints.

For context, a sector is like a cone but the outer boundary is circular in nature, as opposed to being a straight line.

Reference:

I don’t need to detect enemies in the sector because I will probably end up using circle detection and then checking the angle between cast origin and target.

I have considered using a sector material, but I’m not sure how I would change the arc.

I have successfully implemented skill range indicators and full circle area of effect indicators, just having trouble with sectors.

Any suggestions or advice would be appreciated. If this is already a function of Unreal Engine, I apologize, as I’m new and can’t find any information about it anywhere. I thought it would be a common topic.

Thanks in advance.

Edit: I technically do not need to use a decal, as long as the desired outcome is achieved.

Use an image like this one, then in the material use an if statement with the white values.

You could use another texture for the circle.

I need to go now but If you need more help comment and I’ll help you in a while.

222988-help2.png

Wow, nice creative solution! Conceptually I understand what you mean but I don’t know how to implement it. I’ll give it a shot and let you know how it goes. If I haven’t followed up when you return please assume that I haven’t figured it out.

Edit: Got it working! All I need to do now is somehow pass in the threshold.

Edit 2: Got the threshold passed in. Working on angle calculations. Seems like the image you provided isn’t linear. Any idea how I could generate a linear version of what you posted?

This works, however there are some rough edges, this could be fixed with blur or something else.

Thanks, yeah that’s how I ended up implementing it. Again though, the gradient isn’t linear 0-255. The angle and 0-1 inputs can’t be linearly mapped. Look at the resulting angle difference between param = 0.1 and param = 0. Am I doing something wrong?

oh, ok.
I just did the same thing mathematically and works well.

Quick question, what’s TexCood?

That is the uv coordinate, so the center of the UV has a TexCord of (0.5,0.5)

Made the input param linear and degrees

3 Likes

Edit: Sorry didn’t see your linear + degrees stuff above. You are doing God’s work, the hero that we have, not the hero that we deserve!

All fixed man, you’re the best!

Thanks to everyone on this thread! It really helped me! Just one question: which scalar-or-whatever controls the radius of the circle?

Add center offset, incase of using for annual sector shape.

How do modify radius?