Originally posted by Gbr
View Post
What you'll want to do is figure out how many options you want in your menu, and divide 360 by that number. We'll call that A. A is the angle between each item in the radial menu. Then what you want to do is make a ForLoop with the range of 0, to number of menu options, minus 1. The Index output from the ForLoop should be multiplied by A. We'll call the resulting value I. The Sin of I and the Cos of I will give you the menu option's x and y position at the given index within the loop, in the clockwise direction. We'll call that vector P. Multiplying P by a number will determine the menu's radius.
By creating widgets on the screen via this loop, you know where you need to create the widget on the screen based on the current index in the loop.
You can determine which menu option is selected based on joystick angle or mouse position using the following function:

You can create the following in your character Blueprint to visualize how it works:

Get Mouse Position Cartesian is a custom function that makes a vector from the center of the screen to the mouse position. Here is how it's made:

Leave a comment: