0
Not a bug

Is it a bug in the built-in action ActionTransformMove?

Quincy Huang 5 months ago in Game Creator updated by Marti (Lead Developer) 5 months ago 1

I am wondering if it is a bug. 

I guess position2 is the place where we need to go to.

As the red arrow points out, the postion2 is getting the invoker's local variable. Which is not the result I want.

I expected the postion2 would be the local variable of the object which I specified in the inspector.

My case is. 

I have a Main object, which located at (0,0,0), and it calls the action function attached to another object (Sphere) which placed somewhere.

The Sphere has a local variable named "New Position".

So, the invoker is the Main object in this case.

When I play the game. The Sphere always goes to the (0,0,0). which is the wrong place. It should go to the New Position.

Is it a bug?

Unity version:
Game Creator version:
GOOD, I'M SATISFIED
Satisfaction mark by Quincy Huang 5 months ago
+1
Not a bug

It's not a bug. The "target" variable inside the Execute() method doesn't reference the member at the top, but the parameter passed to the Execute() method.

Remember that Invoker is the object responsible for calling the Action. So if you set both the "Target" field to Invoker as well as the "Move To" field to Invoker, they will both reference the same object.

As a tip, if you want to know which object the Invoker references, use the Action "Debug Name" and print the value of Invoker. This print in the console the name of the object used as Invoker.

It's a bit complicated, and I hope to change how this works for Game Creator 2.0. It's a source of confusion.