![]() So we will assign the return value of PlayEvent2D to the InstanceWrapper: void ATutorialCharacter::PlaySound() PlayEvent2D will return an FFMODEventInstance. In the Character.cpp file we will play an Event by calling UFMODBlueprintStatics::PlayEvent2D. We can now finally implement the two functions we declared earlier. ![]() PlayerInputComponent->BindAction("StopSound", IE_Pressed, this, &ATutorialCharacter::StopSound) Playing and stopping an FMOD Event using C++ PlayerInputComponent->BindAction("PlaySound", IE_Pressed, this, &ATutorialCharacter::PlaySound) In the same header file, declare the functions PlaySound and StopSound: void PlaySound() īefore proceeding, let’s also include FMODBlueprintStatics.h and bind the two Action Mappings in the SetupPlayerInputComponent function of your Character.cpp file: // FMOD Declare the FFMODEventInstance variable, which is a wrapper for FMOD’s Event Instances: FFMODEventInstance InstanceWraper
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |