void NewTurnIsReady(EBowlAction _action) { if (MyMeshComponent == null) { return; } MyOwner.SetActorLocation( MyStartLocation, false, out myHit, false ); MyOwner.SetActorRotation( MyStartRotation, false ); MyMeshComponent.SetSimulatePhysics(false); MyMeshComponent.SetSimulatePhysics(true); }
void LaunchBall(FVector launchVelocity, UBowlingBallComponent bowlingBall) { if (MyMeshComponent == null) { MyOwner.PrintString("Please Assign A mesh component to the uproperty", FLinearColor.OrangeRed); } else if (MyAudioSourceComponent == null) { MyOwner.PrintString("Please Assign an audio component to the uproperty", FLinearColor.OrangeRed); } else if (BallRollingSound == null) { MyOwner.PrintString("Please Assign a sound clip to the ball rolling sound uproperty", FLinearColor.OrangeRed); } else { MyMeshComponent.AddImpulse(launchVelocity, MyMeshComponent.GetAttachSocketName(), true); MyAudioSourceComponent.Sound = BallRollingSound; MyAudioSourceComponent.Play(); } }