Pie menu handler unable to interact with my code
I have this pie menu event handler, which I am certain is being called: (me using Mode instead of AIMode is intentional, by the way)
Code:
function GoTo(actor)
actor.Mode = Actor.AIMODE_GOTO;
print("Pie goto");
end
But you know what's weird? Even though I've confirmed it's the same Actor, (same ID, everything) any custom variable (like, not something such as Weight) is nil from GoTo's point of view. So, for example, in the Create of the actor, I set self.Mode to Sentry, the constant for 1, but then when I look at it from GoTo, it's nil. The function acts like a little tempory black hole, where any change to actor is completely ignored by the rest of the code, and forgotten when the function finishes.
What can I do to fix this? This is weird ._.