Frictional Games Forum (read-only)

Full Version: Making chests fly open with touched.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
So I know the callback function
Code:
SetEntityPlayerInteractCallback("chest_small_6","Chest1",true);
would be used, and the function that it would call to would look something like
Code:
void Chest1(string &in entity)
{
    AddPropImpulse("chest_small_6",0,25,0,"");
}
but the problem with this is that when a player opens the chest, he is grabbing onto it and so no matter how large the impulse the lid will be held in place by the player (well it will fly open and then fly back to a semi-closed state, or wherever the player's cursor is). Is there any way to get around this? (such as a way to make the player let go of the chest before it is sent flying open?)
I think you can use SetEntityInteractionDisabled("chest_small_6", true); to disable the interaction on the chest just before you give it the impulse, then shortly after you can turn on the interaction again.