D
Docker
Guest
I'm attempting to create a vision cone for a camera within my game but I've been stuck on this for 4 hours and I'm too stupid to see what I'm doing wrong
Inside the obj_camera object create event I have:
Inside my draw event for obj_camera_vision I have:
It rotates with the camera object but the vertexes move and warp the shape of the cone, can someone please tell me what I'm misunderstanding? I've been creating and deleting code for 4 hours trying to get my head around this and I'm at the point of having a nervous breakdown...
It performs the shape as intended without obj_camera moving
Inside the obj_camera object create event I have:
Code:
camera_vision = instance_create(x, y, obj_camera_vision);
camera_vision.creator = id;
Code:
draw_primitive_begin(pr_trianglelist);
draw_vertex(x, y);
draw_vertex(x+lengthdir_x(100, creator.image_angle), y+lengthdir_y(100, creator.image_angle-20));
draw_vertex(x+lengthdir_x(100, creator.image_angle), y+lengthdir_y(100, creator.image_angle+20));
draw_primitive_end();
It performs the shape as intended without obj_camera moving
Last edited: