I have an entity that is attached to a vertex of another moving entity (a gun in player's hand). This is the simple code I use to keep the gun in place.
Code:
my.x = ptemp.x;
my.y = ptemp.y;
my.z = ptemp.z;


Ptemp is obviously a vector which keeps that specific vertex's position. The problem is, though, that in fullscreen the framerate of the game is lower, and the gun begins falling behind the player when he moves. All of a sudden the gun is behind the player's hand instead of in the place they should be.

What should I do to make it so the gun keeps up with the vertex? In windowed mode it's perfect.