Hello,
I will try to explain as best as possible: I followed the tutorial for setting up multiplayer in Godot, so I now have a level which loads, which is initially started and owned by the 'host', to which a 'guest' can join.
Im syncing a few properties such as position, playerId, velocity, rotation
The characer.tsn has 2 Camera3d nodes (CameraGame, and CameraCloseUp), with a 3rd camera called Camera3D which is an InterpolatedCamera3D (from here: https://godotengine.org/asset-library/asset/739).
The idea is Camera3D is what is 'used' and it moves between CameraGame and CameraCloseUp for certain events. It works fine in single player.
It works fine when host first starts the game, and it also works fine for the guest who joins.
But once the guest has joined, host seems to lose this camera movement logic, it wouldnt follow the player any more.
Ive got code in the character _ready() func that does the following:
if player == multiplayer.get_unique_id():
$MyCamera.current = true
Infact until I added the below , when the guest joined, host lost ALL its cameras and it went to a static view (which looked like it came from guests initial load position)
func _ready():
$Camera3D.current = false
$CameraCloseUp.current = false
$CameraGame.current = false
if player == multiplayer.get_unique_id():
print('set camera plase !!!')
$Camera3D.current = true
($Camera3D as InterpolatedCamera3D).target = $CameraGame
With the setting of false, it seems my host is allowed to keep his Camera3D and it follows him again.
However it cant move to $CameraCloseUp.
Is this a misunderstanding on my part of how camera.current
- despite being in 2 separate game windows - over rules both instances of the game?
The behaviour im seeing suggests that...
But from a programming POV i find it a bit odd... Do I need to do something a bit more complex to get this to work?