The temperature gets affected.
Sorry for a late response.
So a state is determined (predominantly) by energy, specifically thermal energy.
When a solid gains energy, it becomes a liquid. When a liquid gains energy, it becomes a gas.
Likewise when a gas loses energy, it becomes a liquid, and when a liquid loses energy, it becomes a solid.
THIS IS A GENERAL RULE; THERE ARE EXCEPTIONS
This is because of the particle motion. When a particle gains energy, it moves faster. This increases thermal energy within the molecule. The increased thermal energy results in a change in state. It is the same when a particle loses energy.
Hope this helps :)
Here's how I would explain it.
The particles in a solid are strongly attracted to each other.
They vibrate back and forth a little bit, but they do not move past each other.
Solids keep their shape because of these strong attractions
When we add energy in the form of heat, the particles move faster.
They can slide past each other, but the attractive forces keep them close to each other.
As we add more heat energy, the particles move faster and get a little further apart.
If we add enough heat energy, the particles in a liquid will be able to escape from each other completely.
The particles will then be so far apart that the forces between them will be very small.
They will become a gas.
Here's an interesting video on the states of matter.