Legacy GM point_to_object not working (SOLVED)

Y

Yvalson

Guest
so I'm using point_to_object in this script:

Code:
if(instance_exists(Obj_Inscriptiontable1)){
if(distance_to_object(Obj_Inscriptiontable1) < 3){
    show_debug_message("Close")
    if(global.Mission[1] = 1 && global.MissionQuest[3] = 1 && global.Inchat != 1){
        global.Inchat = 1
        newChat(global.Inscription_Mission_One_Quest_Three_Dial, "none");
        global.MissionQuest[3] = 1.5
    }
    else if(global.Inchat != 1){
        global.Inchat = 1
        newChat(global.Inscription_Munaty_Forest, "none");
    }
}
}
when I stand right in front of the object it still does nothing and debug isn't showing that im close

when use
if(distance_to_object(Obj_Inscriptiontable1) << 3){
instead for some reason I can now do the chat but I dont have to be less than 3 pixels away
what's wrong with the code I already tested what the distance was and it works with Obj_Inscriptiontable2
which uses only slightly different code:

Code:
if(instance_exists(Obj_Inscriptiontable2)){
if(distance_to_object(Obj_Inscriptiontable2) < 3 && Obj_Inscriptiontable2.Read = 0 && global.Inchat != 1){
    Obj_Inscriptiontable2.Read = 1
    global.Inchat = 1
    newChatB(global.Inscription_netcireh_dessert, "none");
    Spell_Teleport = 1
}
else if(distance_to_object(Obj_Inscriptiontable2) < 3 && Obj_Inscriptiontable2.Read = 1 && global.Inchat != 1){
    global.Inchat = 1
    newChatB(global.Inscription_netcireh_dessert2, "none");
}
}
 
Top