I have a problem when initilizing a class where the texture doesn't load. I have two examples of the problem. One where it works and one where it don't.
// Plane
// Location of the plane's sprite, location of the plane's gun sound, the starting position of the plane, and the health of the plane
playerAircraft player_plane("data/plane/airplane3.png", "data/plane/audio/gun.ogg", sf::Vector2f(250, 400), 100);
The example above works and I can see the plane's sprite. That is the player's plane. I'm using a vector of the class enemyplanes which inherits from the base class airplane. This is the code I'm using to create a new plane.
// Location of the plane's sprite, location of the plane's gun sound, the starting position of the plane, and the health of the plane
enemy.push_back(enemyAircraft("data/plane/airplane3.png", "data/plane/audio/gun.ogg", sf::Vector2f(player_plane.getPlanePosition().x + 200 + rand()% 200, player_plane.getPlanePosition().y), 20));