GMS 2 Using move_towards_point(x,y,speed) to make a path not functioning properly

F

Falconsoft-Industries

Guest
step event for Obj_cutscene_prop1:
If !place_meeting(Obj_trigger1.x,Obj_trigger1.y,Obj_cutscene_prop1)
{
move_towards_point(Obj_trigger1.x,Obj_trigger1.y,4)
sprite_index =spr_jack_oshimatao_walking_south_east
image_speed =4
}
If place_meeting(Obj_trigger1.x,Obj_trigger1.y,Obj_cutscene_prop1)
{
move_towards_point(Obj_sub_trigger.x,Obj_sub_trigger.y,4)
sprite_index =spr_jack_oshimatao_walking_north_east
image_speed =4
}
If place_meeting(Obj_sub_trigger.x,Obj_sub_trigger.y,Obj_cutscene_prop1)
{
room_goto_next()
}
Will this work?
 
F

Falconsoft-Industries

Guest
As long as there's only 1 Obj_trigger1, for starters.
There is but the cutscene object does not move to the target like it should it just moves there and continues moving until it is off the screen.
 

TheouAegis

Member
Wait, your obj_cutscene_prop has a collision check for obj_cutscene_prop? I think you mean to use position_meeting(), not place_meeting().
 

NightFrost

Member
You are testing a collision against itself, and I can't remember if place_meeting can check for collisions with self. In any case that behavior seems a little odd. If the collision cannot fire, the instance should move to obj_trigger1 and then start shaking there as the move_towards_point likely overshoots the exact position. If the collision can fire, it should turn towards obj_sub_trigger and move there until it is no longer in collision with obj_trigger1 then turn back as the first if-check again takes over. Keep in mind though that when you use move_towards_point, it sets a speed, so the instance will keep moving even if you don't call that command.
 
F

Falconsoft-Industries

Guest
Wait, your obj_cutscene_prop has a collision check for obj_cutscene_prop? I think you mean to use position_meeting(), not place_meeting().
Perhaps that could work, I will give it a try...
Basically I am trying to make a isometric path to one point to another and then stop at the next point.
 
Last edited by a moderator:
Top