Ocean not rendering (only during runtime)

Hello, the Ocean that I’m using only works during runtime. Is there a fix for this? The only way I can see it is during runtime so it’s a little hard to work with. I have some screenshots:

They are the same screenshot, the first is during runtime, the second in editor mode. What could be causing this? The Ocean is a script attached to an empty gameObject. Any ideas?

Thanks.

1 Answer

1

“The Ocean is a script attached to an empty gameObject.”

Did you explicitly tell the script to run in editor mode? If not, it won’t appear outside runtime. Add the following and you should be good:

javascript

@script ExecuteInEditMode()

for C#, add this above your class declaration-

[ExecuteInEditMode]

Worked perfectly, thanks!