How to get a reference to a UMG widget in the level blueprint?
Hey, I'm having a bit of trouble getting event dispatchers to work in ue4. Bear with me, I'll explain what I'm trying to achieve first, then get to the meat of the problem. This is for a murder mystery game. I have some textures of flat areas on some static meshes in front of the player character. They do not have control over the camera, so the image of the room is their entire world. As they stand in front of each static mesh, they are overlapping a trigger box. Upon overlapping, a widget is cast to their viewport. I also have some 360 investigation scenes with a spherical photo on a sphere static mesh- in these, the player may control the camera and look around. To move from area to area, I'm trying to set up an event dispatcher that will communicate between the widget and the level blueprint, as the level bp seems to be the only place I can get a reference to any character... tell me if I'm wrong, and if there's a different way to go about this. Upon clicking a button, the player should teleport to a new area, ceasing overlap with one trigger box and beginning overlap with another, allowing for separate UMG widgets to be displayed, so they can act as new "areas". I'm also wanting to use an event dispatcher so that I can possess a different character- the one with the camera controls. This would be achieved by using a transform node first, teleporting character one to an empty area, and then using a possess node, and vice versa for switching back with character two. So that's the background out of the way, now for the problems. The "evidence" variable being used in the first picture is from a trigger box in the level, which is featured in the second picture. The overall idea is simple enough, when they're in the box, create the widget and cast it to the viewport. When they're not, remove it from parent. However, I'm not sure I'm correct with the following- my line of logic is that I could promote it to a variable in this BP as I create the widget, due to the fact that this is the blueprint responsible for creating the widget. The functionality promotes it to a variable upon overlap. If that overlap does not happen, then the branch sets it to false and it's removed from parent, as stated before... however, that variable reference seems to be behaving strangely, as I'm sure you can see in picture one: I don't know what it's asking for. Picture four shows the error that it's receiving, but I don't understand it. Picture three shows the level itself so you can get an idea of the sort of place I'm making. Also, a smaller problem- in picture one, the transformation and rotation node... is that setting correct if I want to teleport ParlourChar to the xyz coordinates of 5,5,5? The only real reason I doubt it is because this tutorial https://www.youtube.com/watch?v=68pmsZ2L3PE uses these nodes https://docs.unrealengine.com/…/Behavior/GetValue/index.html and I'm having trouble finding their function or how to use them, as it isn't explained in the video. Sorry for the wall of text, and I appreciate your time.
asked Oct 13 '17 at 09:57 AM in Using UE4
Follow this question
Once you sign in you will be able to subscribe for any updates here