show hide actor
hi, i'm trying to show and hide actor (widget) on line trace. It works, but when it's hide i can't show it anymore. Does anyone know how to fix it ? thanks in advance.
asked Jan 17 '18 at 12:29 PM in Blueprint Scripting
Try using the Set Visibility node instead:
answered Jan 17 '18 at 12:35 PM
A few comments:
One solution to your problem: put the SetVisibility(true) node AFTER calling the SpawnWidget (in your screenshot, you are setting the visibility to true... then spawning the widget)
More proper solution: you should Spawn the Widget elsewhere (beginplay ?) and just change the Visibility to true or false after. There is always a cost to spawn Widgets and Actors and it should be done only when necesary
answered Jan 17 '18 at 10:04 PM
I don't think there is a bug. Here is a screenshot on how to achieve what you want on a Character Blueprint (could be done elsewhere)
In this example, the EventTick is there to perform the line trace each frame, so that when your character is in front of an ActorWidget, it selects it and keep a reference in SelectedActorWidget.
In a second step, once an ActorWidget has been selected with your LineTrace, in this example you can Toggle the ActorVisibility visibility with the F Key. It works both to show and hide the actor.
Rather than performing a LineTrace at each Tick to select the ActorWidget, you could do one LineTrace for instance when the User is triggering a key, mouse or motioncontroller button.
answered Jan 19 '18 at 11:41 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here