I am trying to chnage the Waves Asset via Blueprint and have not been able to figure out how.
Anyone?
There is a Set Water Waves Function but I have not been able to create the Water Wave Base Object Reference. Tried various castings to gerstner waves, I just cant figure out how to make this input.
I figured out how to do it in C++ just need a Blueprint version
cpp version
// Fill out your copyright notice in the Description page of Project Settings.
#include "AdjustWaterWaves.h"
#include "WaterWaves.h"
#include "WaterBodyLakeActor.h"
#include "Kismet/GameplayStatics.h"
void UAdjustWaterWaves::ChangeWaterWaveAsset(UObject* WorldContextObject, TSubclassOf < AActor > ActorClass, const FString& WaveAssetFolder, const FString& WaveAssetName)
{
FString Fullpath = WaveAssetFolder + "/" + WaveAssetName;
UWaterWavesAsset* WaterWavesRef = LoadObject<UWaterWavesAsset>(nullptr, const_cast<TCHAR*>(*Fullpath));
// UWaterWavesAsset* WaterWavesRef = LoadObject<UWaterWavesAsset>(nullptr, TEXT("/Water/Waves/Dan_GerstnerWaves_Lake.Dan_GerstnerWaves_Lake"));
AActor* FoundActor = UGameplayStatics::GetActorOfClass(WorldContextObject,ActorClass);
AWaterBody* WB = Cast<AWaterBody>(FoundActor);
WB->SetWaterWaves(WaterWavesRef->GetWaterWaves());
}