The effect I am trying to achieve, is to bounce the sprite off the player if the sprite has a certain amount of hit points above 0. I just want the sprite to move jump back slightly and then keep moving towards the player, regardless of the direction it bounces from the player.
I have tried the following bounce setting with various values between 0 and 1 and in the negative as well, but I only get one of two effects: the sprite runs off infinitely in the opposite direction, the sprite doesn’t move and keeps coming towards the player.
@UltimateProGrammer the group definitely is a physics group. If I set the bounce value to 0.25, it is the same the sprite moves in the opposite direction until it hits another object.
Thanks, I’ll keep playing around with this, but at the moment it doesn’t seem to be the solution. I’m still getting the sprite either accelerating to the end of the screen or the drag causes the sprite to stop moving at all. I’ve been trying with the bounce and the drag, but not much luck.
Should I be setting the Y value of drag? I am just setting cauli.setDragX().
Whatever setting I try it seems to behave in the same way, the sprite runs off until it hits another object. The thing is that if I switch off bounce, drag and have nothing happening to the sprite in the collision callback function it still does the same so I am not sure if something else needs to be changed somewhere?
Does the if statement go in the callback function that is called when the collider is activated or am I filtering all the sprites with incorrect velocity in the update method and then applying the new acceleration to all of them?