Okay so, what my intention is for this piece of code is, for when a rocket object is touching the savior object, I want the rocket object to disappear and for some health to be reduced from the savior. But the problem is, whenever I get those two objects to touch, they simply pass through each other. I think it's an issue with my if statement but I'm not quite sure what is wrong with it.
public void Hit()
{
Actor rocket;
rocket = getOneObjectAtOffset(0, 0, Rocket.class);
if(savior != null) {
getWorld().removeObject(rocket);
health = health - 25;
}
}
