• Hello [name]! Thanks for joining the GMC. Before making any posts in the Tech Support forum, can we suggest you read the forum rules? These are simple guidelines that we ask you to follow so that you can get the best help possible for your issue.

Discussion speed

I found out that the speed in all directions is positive in itself and the variable speed reflects the speed modulus or its value, but only I have a function that changes the speed to the opposite, gradually adding to it with the help of motion_add a part of the speed with the opposite sign.
//simple example
speed *= -1;

// lil bit harder but you won't fill difference (i mean animation) because this is happenng too fast (any ideas, how to slow this ?)
var help_speed = -speed;
var time = 20;
var angle = 1 //power(-1, random(4)); (this is for rotation in different direction looks pretty wierd but i don't know how to choose between 1 and -1)
clamp(speed, -4, 4); (i don't think that you will need this, but let it stay here for a while)
for (var i = 0; i < time; i++)
    speed += help_speed * 2 / time;
    image_angle += angle * 180 / time;
And when I made the speed display, I saw that the speed of my object (speed) in any direction is greater than or equal to 0, but that function changes not only the direction of the speed, but also its sign, which is why the speed in one direction will be 4, and in the other -4. It's a little confusing for me, to be honest.
Last edited: