-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Describe the bug
Let's say I want to make both of my Player objects always face towards my Ball object. I have the following code:

It gives me the intended behavior.

I believe this is because of Player.X -- it's ambiguous because there are two "Player" objects in the scene. When I am comparing the Ball's position to Player.X, which Player do I mean? GDevelop seems to assume I mean the one on the left. (IIRC, I created that one first.) That means both Player objects adjust their orientation depending on where the first object is, not on an individual basis.
I think that GDevelop should warn the user when it encounters an ambiguous variable like this and has to assume the answer. It could display an icon next to any events with ambiguous variables to aid in bug-hunting. So in this example, after I typed "Player.X", GDevelop could have caught that there were multiple Players in the scene and warned me. Or, it could have warned me when I ran the scene with a popup like: "Variable "Player.X" is ambiguous, because there are multiple instances of "Player" in the scene."
To Reproduce
See above description and included file.
2020-02-05 Ambiguous variable.zip
Other details
Windows 10 1909 x64
GDevelop 5 beta 88

