#I'm trying to use code to detect walls and such, but it doesn't work right.

4 messages · Page 1 of 1 (latest)

trim lava
#

with Line {

    while (!place_meeting(x,y,O_Wall)) {
        image_xscale += 32;
    }

    while place_meeting(x,y,O_Wall) {
        image_xscale-= 1;
    }

    Person.WallSpotX = x + lengthdir_x(image_xscale, image_angle);
    Person.WallSpotY = y + lengthdir_y(image_xscale, image_angle);
}

This is my code, but it's causing issues like the ones in the video. O_Wall is the blue material. Line is provided an image angle based off a angle from a controller joystick. The lasers come from the eyes and are based off this Line object. 😭

heady cargo
#

What is the collision mask settings of the laser sprite?

#

if it's still set to "rectangle" then that could be the problem, the mask wouldn't rotate properly

#

you'd want rectangle with rotation or precise