Check if player is playing Singleplayer or Multiplayer

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By Rubin

Hello! I’m making a game in Godot 4 that has singleplayer and multiplayer. I want to make scenes that can be used in both modes so it can save time and resources, but there are scenes that needs to behave a little different depending whether it’s singleplayer or multiplayer. Is there a method to check whether networking is being used or not?

:bust_in_silhouette: Reply From: jgodfrey

Functioning multiplayer network code is bound to have some amount custom code provided by you. I’d suggest that you simply find an appropriate place in that code to set some global, boolean variable to true when you know your network code is being used.