Hey y'all. I am having a lot of trouble making an actor appear only when my main actor is touching an interactable object. I will leave u the code I think is relevant here together with the try I have made in order to make this work. Some help would be greatly appreciated.
This code right here is inside my main actor class, "Lucas":
This code is for spawning the Actor at the bottom left of the screen:
public void touching_interactable_object()
{
Actor z = new Interact_Button();
spawn_Interact_Button(z);
if (isTouching(interactable_objects.class))
{
z.getImage().setTransparency(100);
}
else
{
z.getImage().setTransparency(0);
}
}public void spawn_Interact_Button(Actor z)
{
getWorld().addObject(z, 30, 450);
}


