Skip to main content

Switch Character Controller Input

Key Problem

  • Toggle between player input and AI input on disconnect
  • Takeover input authority for another object (bots) if the need arises and vice versa.

Expected Output/Definition of Done

  • able to switch from player-controlled to AI-controlled and other way around seamlessly

Key Solution

  • In Server Mode, there is no default Player Ref for spawned object who does not define its Player. so their player authority set to None.
  • The system works around giving and removing authority upon network objects. an object who does not have authority but has a unit controller component attached, is considered as bot.
  • In the research; PlayerName used as identifier to determine if character already spawned or not. this enable player to rejoin and recover its character authority. however, in real environment, kindly consider using much better and secure way to identify character.
  • Below a quick demo of character controller in action.