Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save theresajayne/dae65f355a891cbf5f1e355356efb6e5 to your computer and use it in GitHub Desktop.
Save theresajayne/dae65f355a891cbf5f1e355356efb6e5 to your computer and use it in GitHub Desktop.
// Called every frame
void UOpenDoor::TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction)
{
Super::TickComponent(DeltaTime, TickType, ThisTickFunction);
//Poll the trigger volume
if (GetTotalMassOfActorsOnPlate() > TriggerMass) //ToDo make into a param
{
if (!isOpen)
{
OnOpenRequest.Broadcast();
}
}
else
{
if (isOpen)
{
OnCloseRequest.Broadcast();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment