Skip to main content

UpdateGripEachFrame

A class in Root.Township, the global namespace.

Keeps re-checking the grip on a held pickup every frame while it is held, without letting that move the object.

Constructors​

MemberWhat it is
UpdateGripEachFrame()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

1 private and internal field
MemberWhat it is
private Pickup pickupThe pickup on this object.

Methods​

3 private and internal methods
MemberWhat it is
private void Awake()Hooks the pickup's grab event.
private void InteractionStarted(Interactable interactable, Interactor interactor)Turns the component on when the pickup is grabbed.
private void Update()For each holder, tries a grab change and then restores the transform; turns itself off when nobody holds it.