Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void AMyProjectCharacter::MoveChosenActor()
- {
- //Get the static mesh of the chosen Actor
- UStaticMeshComponent* SM = Cast<UStaticMeshComponent>(ActorToMove->GetRootComponent());
- //If the static mesh is valid apply the given impulse
- if (SM)
- {
- /*When you want to apply an impulse you always need to multiply it's value by the
- mass of the object that the object is applied to.*/
- SM->AddImpulse(ForceToAdd*SM->GetMass());
- }
- else GLog->Log("Root component is not a static mesh!");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement