Add force to bullet in the network

Hi, I have a problem with the AddForce method:

When a player fire I istantiate an object called proiettile withi this code:

proiettile = PhotonNetwork.Instantiate(proiettilePrefab, muzzleFlash.transform.position, muzzleFlash.transform.rotation, 0) as GameObject;

Then I add force to it:

proiettile.rigidbody.AddForce(-transform.forward * 10000);

In the local player (the one that fire) bullets have force, but the other player sees only the istantiated bullets with no force that fall on the ground.

I added a PhotonView to the bullet prefab that observe the rigidbody of the bullet, but nothing happens.



What you want to do instead of having the player script add force to the bullet, is have the bullet propel itself.

Give the bullet the force at Start() so when it instantiates it will propel forward everywhere.

But I can’t make that the projectile can be launched in the right direction if I turn my head…How can I attatch properly the launching of my projectiles to the direction where I’m looking at?.

I think that you should work with the projectile as a child of the player.