So, There is a bug here. Can anyone fix it?
-
So, this is the version 2 of the current movement script for the AI of This New Ocean. I ran into a bug where the bot won’t change their target coordinates when approaching it. Any help?
-
@sirbots try adding a console.log or set variable to with the distance block, I dont see an issue here sso that’s the main way to debug
-
@tyller_ Here is the full movement code if you want to look at it.
Note: Scroll X and Y changes based on the player’s movement. Not X and Y cords.
-
-
@sirbots The say block is for the debugging.
-
@sirbots copy and/or take the distance block and make it so a variable sets itself to the distance (or make it say the distance) or just drag it out, that way you cna see what hte distance is each frame
edit: The only thing I can think of rn is maybe you mixed up cos and sin (like got them backwards) cus I dont know that off the top of my head
-
@tyller_ So, have a separate variable for the distance?
-
@sirbots yes, do that or just copy the distance block and put it in a varibel set in the forever loop, then set so that variable is shown, or just make it say the distance in the forever loop. The intent is to see whats changing with teh distance
-
@tyller_ Got it!
-
@tyller_ The Distance is going down at very small increments. Note that the Scroll X and Y serves as the Player’s X and Y cords. Maybe that might play a part.
-
@sirbots can you add a thing to draw a circle on the target? does the bot appear to be not moving anymore/on the target when its going down slowly? whats the distance showing (rounded)?
-
@tyller_ Let me send you a copy of the game version, so you can look at it.
-
-
@tyller_ WAIT! I fixed it. Variables were in the wrong places.
-
@sirbots Im curious, was it misplaced blocks elsewhere? or did you accidentally set something like box or the change thing to something else
-
@tyller_ I used the wrong operators, and I didn’t have the proper distance variable in the movement scripts.