SetRelativeRotation "no instance of overloaded function"

This line of code gives me the error:

SetRelativeRotation(FRotator(NewElevation, 0, 0));

Error:

no instance of overloaded function "UTankBarrel::SetRelativeRotation" matches the argument list and object (the object has type qualifiers that prevent a match)

Anyone know what’s wrong?

The error above is from intelli-sense, but the compiler says this:

'USceneComponent::SetRelativeRotation': 2 overloads have no legal conversion for 'this' pointer

Is your function const by any chance? Because that’s a non-const function.

Ah, yes, it was. I see now why that wouldn’t work, because it’s changing something about the object. Thanks!

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.