Okay so hear me out for a second. I know there are like seven billion other users with a similar issue, but I couldn’t find someone with my specific problem, and it’s been frustrating me ever since I started working on this specific project like a month ago.
I have an enemy object that I am programing AI for, his name is Bunnydude. He has floppy bunny ears, and he can do this long swooping arm attack that I learned sin() and cos() to create!
The player can also play as Bunnydude, and he’s really fun to control! I didn’t wanna duplicate objects in the editor, because that gets really messy. So, I only used one object, and I keep track of which is which with an ID variable. Players use negative IDs, starting at -1, and NPCs use positive IDs, starting at 1.
At the beginning of the scene, it gives all the pre-existing objects a unique ID that starts at 1 and counts up. I will refer to NPC objects as 1.
Then, it spawns the player, and gives them an ID of -1. I will refer to player objects as -1.
For -1, it just grabs keyboard inputs, and stores them in the input array for that object.
For 1, it has AI events that trigger when certain things happen, that triggers the variables in the input array of object1.
Now for the ISSUE.
Things just break. At the begining of the scene, the bunny ears and the arm swing attack break, all the ears seeming to only go to one of the bunnies with all the other bunnies being earless.
And the attack does… this. It never swings, and never disappears. Holding down the button creates new arms constantly, creating this paint smear effect:
Not to mention, all the movement breaks after a while. It only happens while the player is pushing buttons I think. When movement breaks, it’s like the input array just doesn’t exist anymore, cause nothing inputs or does anything, no matter what you try. If you’re mid jump, you will finish the whole jump and reach the floor fine, so they game isn’t crashing…
Note, I programed my own physics that use object points and positions, and variables. I didn’t use the default physics engine, cause it is so incredibly janky. I will give examples of the default physics engine not working if they are needed, and I will also provide my custom physics events if needed, although, they’re very rudimentary, and they aren’t what’s causing issues, I know that’s for sure. I think it has something to do with how “Repeat for each object:” events work, but I’m not sure exactly how.
Any help is greatly appreciated, even if we don’t fix the issue. Redirect me to a different topic if my exact issue really WAS already posted here, but I’m 99% sure it wasn’t!