I’m creating an environmental simulation where populations of wildlife change on a daily basis from predation, hunting by player and natural deaths. When the player saves, the calendar is moved forward 1 day and a calculation is done for wildlife population (running on assumption predation happened overnight). Player saves by interacting with a cube actor I placed in the world using a sphere trace and event dispatcher called Interact.
When the player hits Interact on the SaveGameCube I want the SaveGameCube to cast to the DayNightCycle to access the date to save as a variable to be stored with animal population data in a table (in picture). I’ve tried to do this in multiple ways including ShereTraceByChannel, creating an actor variable type in the blueprint, GetActorsOfClass, but the cast fails. The event dispatcher from the third person character is working fine though. The animal populations is saved in a sublevel which I’ll add later once I’ve got this figured out.
I’m still getting used to casting and I’m really struggling to find out any good information about casting from different actors and not the third person character, specifically object related. Any help would be greatly appreciated!!