Bug that is making me want to crash out

This line right here


should make beam of light trace back and forth randomly between two locations. I basically the exact same code running on two other beams that is more complex and works perfectly fine. I have the same code in a different project that is working perfectly fine. For some BIZZARE REASON it stops and doesn’t move. I’ve tried vx, I’ve tried ax, neither affect it. I can force it to move, but I for the life of me cannot find a single line in this project that is telling the sprite to stop and set its vx to 0.
Project with bug: (attached as file because its north of 7000 blocks/30k lines)

Project where it works fine:

it is SUPPOSED to work like in this project, but the middle one is making me want to delete the whole game, I’ve spent way too long trying to debug this and can’t for the life of me find anything wrong with it.
ignore sound on the main project, I havent finished a dynamic audio system
any help is big appreciated

5 Likes

@xTear do you have a tilemap in your project? possible that the sprite is hitting a wall somewhere.

to ensure the sprite isn’t interacting with anything else, try setting the ghost flag to true on it. you can find the ghost flag in the same dropdown as auto destroy

that flag prevents the sprite from hitting walls, overlapping with tiles, or overlapping with other sprites.

2 Likes

Hey, thanks for the reply Richard. I’ve seen a ton of your stuff, you’re an inspiration for me actually. Yeah, I do have a Tilemap but that shouldn’t have been a problem, and ghost was enabled. I did fix the bug by deleting the variable and all references to it and coding it again. I still have no idea why it wasn’t working, but perhaps it was because I was working on it at 2am.
Cheers

2 Likes