[SOLVED] PUN v2, Object position instantly snaps to (0, 0, 0)

Options
Reeii
Reeii
Hello, I've encoutered a very weird bug and I hope that I can explain it well enough.

I have a player object which can shoot an fireball. The fireball is a prefab that is instantiated once per player and then only it's Mesh Renderer is enabled and disabled to make it disappear. My Shoot() function sets the position of the fireball to the player's position and then adds a force to its rigidbody. This works always with one player, but if the other player in a room uses it, the following things happen:

- The fireball position is set to the player's one (as intended)...
- ...but then quickly resets to (0, 0, 0)
- The Network Position of the PhotonTransformView always remains (0, 0, 0), thus the fireball stays always in (0, 0, 0) on the device that's not the one that the player with the buggy fireball has

I hope you understand what I mean... :s
Thanks in advance.

Comments

  • Reeii
    Options
    A few other info:
    - The owner of the photon views of the fireballs is the Scene
    - Only the PhotonTransformView is observed
    - Apparently the buggy fireball that's stuck in (0, 0, 0) is always the fireball of the player that joined the room afterwards, not the fireball of the player who created the room
  • Reeii
    Options
    Never mind. I finally solved by setting the ownership of the PhotonView to the player to which the fireball belongs to.