Accessed none trying to read property (variants)

I’m trying to create a blueprint that will allow me to change a series of cushions in real time via variants. Here’s the script I’ve got so far:

My Variant manager:

But whenever I go to play, I get the following error messages:

Can anyone tell me what I’m doing wrong? Thanks!

Apparently, when you make the call, you have no actors of type ‘level variant sets’.

hello same problem here found any soluition

Besides that Construct is not the right place to perform this type of action (it runs multiple times and not when you desire), You see that the blue object pin of VariantOption is connected to the switch input, but the var is not updated without executing the white input pin on the variable node. This results in an outdated and invalid variable.

1 Like

ok what is the solution please ?

Connect the “OnClick” node to the GetActorsOfClass node , replacing construct. Then check if the array produced by GetActorsOfClass contains anything, else index 0 will result in out of bounds error.

1 Like

didnt work also my variant is working well in the view port

Facing same problem is there any solution

I FOUND A SOLUTION. It’s very simple and silly kkkk. Just drag the “levelVariantSets” from content browser to the level and voala!

1 Like