Get All Actors of Class UMG Widget crash

I’ve tried in multiple different blueprints to use the function “Get All Actors of Class” from a UMG Widget, and each time it crashes on compile. I know UMG is still somewhat experimental, so I’m guessing it’s just a bug (using v4.6.1) . But I’m hoping someone could help me figure out another way to accomplish what I’m attempting.

I have a single character in my area that I want to teleport from point A to point B when a UMG button is pressed. I was attempting to “Get all actors of [Character]” and grab the first (and only) one. From there I could easily teleport that character. Is there an alternative way I could go about doing this?

Thanks!

Can you give me the Error Log / Crash Log so i can look into your problem?

I don’t know what exactly you are trying to do, so i can’t give you an alternative way.

I though about a Collision box that gets enable when the player presses the button and 0.1 sec after that it gets disabled.
With trigger box has an overlap event for teleporting. You can use the “Other Actor” output of the overlap event to call the teleport on the character (cast it to prevent other things from getting teleported). But this can only be done, when you can guarantee, that the player is always alone in that box.

But since you get “all actors of character” i assume you only have one character at all? So why don’t you just use “GetPlayerCharacter”?

Thanks for the reply. I’ve attached the error log. I’ve also included a simplified blueprint example of exactly what causes the crash (the blueprint is for an OnClick event on a Widget button).

I’m actually working on a game that works similar to the “TellTale” games, so I’m using a combination of collision boxes (to determine if a player is close enough to interact) and UMG buttons for the player to choose which interaction choice they want.

Unfortunately I can’t use “GetPlayerCharacter” since I have two different characters spawned in my persistent world that I will occasionally switch between.

Thanks again!

[log file][2]

Does this error appear if you only use the “Get All Actors of Class” node without the get? Because the error tells about an access violation. Or in other words, you tried to access a variable that was NULL. Maybe the Array that this Node returns is empty and calling teleport on a NULL pointer will through your exception.

If you have 2 players, then i guess you also have 2 controllers spawned right? You could try using “GetPlayerController” with 0 and 1. From this try to use “Get Controlled Pawn”. and use this for your Teleport :X