Fredrik
Member
Hey!
As you can se in the video I have an apple placed on a raft, and when I rotate the raft I want the apple's position to stay relative to the raft.
As you can se the apple's position is on the front end of the raft which is because the length value in both of the lengthdir functions are set to 10 (as seen below).
Code:
What I want is for the apple to stay on the position I dropped it on and not just 10, if that makes sense. I tried setting the length values to be the distance between the raft's position and the apple's position, but I couldnt get it to work.
Cant be that hard. Anyone got a clue?
Sorry for the bad quality.
As you can se in the video I have an apple placed on a raft, and when I rotate the raft I want the apple's position to stay relative to the raft.
As you can se the apple's position is on the front end of the raft which is because the length value in both of the lengthdir functions are set to 10 (as seen below).
Code:
GML:
if place_meeting(x,y,parent_vehicle)
{
var nearest = instance_nearest(x,y,parent_vehicle);
x = nearest.x + lengthdir_x(10,nearest.dir);
y = nearest.y + lengthdir_y(10,nearest.dir);
} else {scr_item_in_water(0.75,2,0);}
Cant be that hard. Anyone got a clue?
Sorry for the bad quality.
Last edited: