Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Get all the nearby actors
- for (auto It = NearbyActors.CreateIterator(); It; It++)
- {
- //Get the static mesh component for each actor
- UStaticMeshComponent* SM = Cast<UStaticMeshComponent>((*It)->GetRootComponent());
- /*If the component is valid, apply a radial impulse from the location of the "Bomb" Actor
- having as Radius and Strength the values from the Editor.
- The RIF_Linear impulse fall off parameter means that we want the impulse to fall off to zero when
- the max distance is reached.
- The last parameter means that we want to ignore the mass of each Static Mesh*/
- if (SM)
- {
- SM->AddRadialImpulse(GetActorLocation(), Radius, Strength, ERadialImpulseFalloff::RIF_Linear, true);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement