Working with Arrays and Rotating Props

I’ve created an array of the type creative_prop. This array has 4 values.
I’m writing a condition where I want to compare the rotation value of each prop, and if they are within a range, I will take it as correct. This is how my code flows -

@editable RotatorProp:creative_prop = array{}
CheckForMatch():void=
if:
Rotation1 := RotatorProp[0].GetTransform().Rotation
if:
Rotation2 := RotatorProp[1].GetTransform().Rotation
if:
Rotation3 := RotatorProp[2].GetTransform().Rotation
if:
Rotation4 := RotatorProp[3].GetTransform().Rotation

    Print({Rotation1} {Rotation2})

In the final print, The Rotation1 and Rotation2 values are throwing an “Unknown Identifier” error.

If I remove the if condition of setting the rotation values, I get an error - This invocation calls a function that has the ‘decides’ effect, which is not allowed by its context. The ‘decides’ effect indicates that the invocation calls a function that might fail, and so must occur in a failure context that will handle the failure. Some examples of failure contexts are the condition clause of an ‘if’, the left operand of ‘or’, or the clause of the ‘logic’ macro."

What is the best way to handle this?

Your print statment needs quotations i think

Print("{Rotation1} {Rotation2}")

Even with the quotations, the error is still the same.
I want to compare the 2 rotation values.

Using it like the way I have below throws a “Unknown Identifier” error

if:
Rotation1 := RotatorProp[0].GetTransform().Rotation

And using it like the below code (without if condition) throws the error of “decided effect”

Rotation1 := RotatorProp[0].GetTransform().Rotation

maybe try

if(Prop:=RotatorProp[0]):
     Rotation1 := Prop.GetTransform().Rotation

Doesn’t work. If you see the attached image, I’ve used rotation in the “MoveBlock” loop, where there is no error. But the error appears in the CheckForMatch function.

Your syntax of your print statement should be Print("{Rot1}") like when you use the print for OriginalRotation

I know this is old, but “Unknown identifier” is telling you that your variable/constant doesn’t exist at that scope. If you define it inside the “if” block, it doesn’t exist anywhere else. Instead, you’ll want to either declare the variable before the if block or use it (print it) before exiting the if block.