Hi, can someone help with this? I’m trying to give a “bounce” animation to item blocks using forces and it seems like it should work consistently using this code:
As you can see, my parameters are that when Mario comes into contact with both the Question Block and the HitboxCheck object, it adds a force directly upward, waits, then adds an equal and opposite force downward. It stands to reason that this would result in the block bouncing up, then down and landing in its original spot, right?
Well, that doesn’t seem to be the case. Sometimes I get the block landing exactly where I want it, but most times, it ends up either one pixel too high or too low.
I’ve tried rearranging the order of events, adding “Stop Object” events between the forces, and tweaking the values, but nothing is giving me any consistent results. Any and all help with this would be greatly appreciated!
EDIT: Additionally, I’ve noticed another problem. As I use the “Repeat for each instance” function for other types of item boxes and bricks, my game starts to lag HARD. I’ve now removed the offending function, but I still need to be able to have the parameters be true for all instances of that same type of object without it being so taxing on the system. The parameters should be able to be reused and tweaked for other similar objects, such as the blocks with items inside, bricks that give a star, and the 10-coin bricks.
But the same cannot be said for the brick object, which is supposed to bounce indefinitely if you’re small Mario. The values seem symmetrical, and the only difference is that the brick doesn’t change to a different animation and keeps playing the tween: