Sync problem.

Options
This discussion is the fixed one from the previous question called "Trigger play".
I managed to make trigger play by editing the code like this
using UnityEngine;

public class helicoptertrigger : MonoBehaviour
{
	public Animator animator;
	
	void OnTriggerEnter(Collider other)
        {
        if (other.gameObject.CompareTag("Player"))
        if (other.gameObject.CompareTag("Remote"))
        {
            animator.SetTrigger("helicopter");
        }
    }
}
But i have a problem.
When somebody joins.
The animation will reset for the player joined, but for the guy in the helicopter no.
How can i fix this?
And the other thing is this, How can i make an animation thats already played synced with other players?
Like the first player that joins, everyone will have the animation to synced like his, Cause i have 2 animations which i want to have synced like the first player.
Cause when a lava is rising up 50%
Other players will have different values.
Same with the helicopter.
Cause when the helicopter is at the end.
Somebody will join and will see the guy on the helicopter flying and will see the helicopter at the start.

Comments

  • Federico123
    Options
    Another question:
    How can i sync footsteps so i dont hear just my footsteps but other players footsteps?
  • Tobias
    Options

    > The animation will reset for the player joined, but for the guy in the helicopter no.

    You could reset it on join?
    Or you need to make the existing player send the animation (frame or whatever) is needed.
    Animations can be synced, too. There is a PhotonAnimatorView that might do the trick.

    Triggers in Unity animations are a hard problem to network. Typically, you want to sync them "manually" by implementing OnPhotonSerializeView and including the trigger.

    In general, this may help:
    https://doc.photonengine.com/en-us/pun/current/gameplay/synchronization-and-state

    Footsteps should probably not get network synced. You can play them as reaction to feet hitting the ground, right? So it could be applied to all characters alike, even those controlled remotely.
  • Federico123
    edited April 2020
    Options
    Tobias wrote: »
    Footsteps should probably not get network synced. You can play them as reaction to feet hitting the ground, right? So it could be applied to all characters alike, even those controlled remotely.

    Will it work like the same thing you said?
    I made my footstep system that uses The player movement controller
  • Federico123
    Options
    Tobias wrote: »
    Footsteps should probably not get network synced. You can play them as reaction to feet hitting the ground, right? So it could be applied to all characters alike, even those controlled remotely.

    Will it work like the same thing you said?
    I made my footstep system that uses The player movement controller

    i mean i have the input script (which is the input script for moving, if this is not put then you cannot move) and fps controller which is the main script that controls moving but needs fps input just for the input part