currently I have an object that rotates based on how long a key is pressed, however I want to change this into a widget that is an editable text box.
for example, if the user inputs 90 in the box, the actor rotates 90 degrees over time (not instantly).
I figured this may be possible by stopping at a certain alpha amount in my timeline, but I don’t know how to do this.
For example, my timelines alpha is 0-1 with the change in rotation being 360 at 1. if the user inputs 90, then its simply .25 through the timeline (90 / 360 ). this can be triggered by a widget button click or a key press.
If there’s a better way, i’m open to changing everything too
this looks amazing and i understand how everything works, however i do had 2 questions.
the answers are probably really simple, however when creating the reference to the widget, how do you actually get the reference to set?
I thought it was just a widget component being added to the object, however it is popping up an error and i dont know where to now get the reference from. i also tried to make it a var that is type widget, but that also didnt work
also, inside your widget, you have the commit method connected to on enter. wehre does on enter come from?
Sorry about all of the questions and thank you again
Then we want a reference to this widget. So we try to get one in the BP_RotatedActor on EventBeginPlay. What happens here? =>
Delay: We need a delay because the widget takes a few ticks to be created
GetAllWidgetsOfClass: Here we get an array of all possible widgets of the specified type (disabled TopLevelOnly ). Currently, there is only one widget in this array, so how do we “get” this widget?
GET : We use the Get node with index 0 to get the first entry of the array (arrays start at index 0)
Create the reference: From the Get node we can drag off of the blue pin and use the PromoteToVariable option
CommitMethod => OnEnter:
When we use OnTextCommitted we have an enum pin to compare it with an existing commit method. To use this we drag off of the green pin and choose Equal(Enum)