Object transform scale changing at different velocities in host and client

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on Fusion.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Object transform scale changing at different velocities in host and client

sabonette
2022-06-04 23:45:55

I have an object that grows in an specific axis, as it follows:

public override void FixedUpdateNetwork() {    
    if (!_growingTimer.Expired(Runner))    

transform.localScale += new Vector3(0, 0, Runner.DeltaTime * 0.2

f);    
}    

However, when the timer expires, the object on the host is smaller than the ones on the clients.

I would like to know why is that and how to solve it.

Comments

ramonmelo
2022-07-19 17:54:03

Hi @sabonette ,

The Transform Scale is not synchronized by the NetworkTransform component, you need to do it yourself, only the Position and Rotation will be in sync.

For this, you can just use a Vector3 Networked Property, and apply the changes on the other peers when the property changes as well, replicating the values from the State Auth.

--

Ramon Melo

Photon Fusion Team

Back to top