It is a bug, but I can't figure out exactly what is wrong.
To test, I created a new game with a simple object, and put this code in the create event
Code:
global.__argument_relative = 1;
action_set_gravity(270, 0.2);
global.__argument_relative = 0;
This is what the compatibility script action_set_relative is doing.
With this code, the object falls sideways to the left instead of down like it should, duplicating my problem.
However, just using the new object as directly imported without adding that code, it works fine.
In my actual game, one of the affected objects has this code:
CREATE:
Code:
action_inherited();
life = 5;
direction = 110;
speed = 12;
image_speed = 0.5;
action_set_gravity(270, 0.6);
This causes the sideways gravity.
If I replace the action_set_gravity script with
Code:
gravity = 0.6;
gravity_direction = 270;
then the problem goes away.
The action_set_gravity script looks like
Code:
/// @description (Old DnD) - set gravity
/// @param dir direction for gravity
/// @param val value to set gravity
var dir = argument0;
var val = argument1;
if (global.__argument_relative) {
dir += gravity_direction;
val += gravity;
} // end if
gravity = val;
gravity_direction = dir;
If you note in there, it is checking the global.__argument_relative, which says to me at some point the "set relative" is not being used correctly, or is not being unset properly.
It being a global variable doesn't make sense, as it appears it is being used by the compatibility scripts to replicate the "relative" check box in old drag and drop items, but if it is a global variable, would not any object using the "relative" box affect any other object as well, including those without "relative" checked? It seems this may be the problem.
As an additional test, I commented out the if statement block in the action_set_gravity script and all gravity functionality returned to normal.