Hi
created a reference variable as in the pic but I get:
PIE:Error: Error Accessed None ‘OceanRef’ from node Get Wave Height Value in graph ‘EventGraph’ in blueprint ThirdPersonCharacter
What am I doing wrong?
Many thanks
Before the ‘Get Wave Height Value’ stick a isValid node to check against the ‘OceanRef’. This way if the OceanRef variable has no value it will ignore the rest of the branch and you won’t get an error.
Best to always check for valid references in your code when getting variables. It’s not so bad in the Unreal Engine as you just get a warning but in other engines and software it would cause a crash.
You are no setting that ocean ref to correct value. Creating variable is not enough it needs to have pointer that points to correct actor.
On event begin play for player character, get all actors of class (and pick class of that ocean thingy), then get element zero from that array and store in ocean reference variable.