I have an object "test" that SHOULD never change it's position, but looking at it in the debuger the position changes as the player moves around. The player never references this "test" object. "test" has this code inside of it:
Step:
dist = point_distance(player.x, player.y, x, y) ang = abs(((((player.direction - point_direction(player.x, player.y, x, y)) mod 360) + 540) mod 360) - 180) xdraw = sin(ang)*dist ydraw = cos(ang)*dist <-----removing fixes problem image_xscale = 1/(1 + ydraw/100) image_yscale = image_xscale depth = ydraw
I tried replacing the mod code I'd never used before, but no luck ![]()
If I remove the cos() line it stops the problem. I also noticed that if i don't initialize the ydraw/xdraw variables in the create the step event will not initialize them.
(also i changed ang to radians since this version because: cos(x) Returns the cosine of x (x in radians). and still nothing)
heres a GMK (used in gm8)
https://www.dropbox....atesproblem.gmk
I have a feeling it's just one of those syntax things, but i thought I've never run into anything like this before so I put it in advanced gml.
Thanks in advanced GMC!



Find content
Male
