Unity CallBack Photon
Lerping position?
PhotonNetwork.CountOfRooms Problem
PUN2 Can't create or join room
Unity Invoice doesn't work for Coupon Code
Question about object transfer control and item ownership
The Photon Analytics page appears to be broken! Help!
RPC , PhotonNetwork instantiate, order of things
Player Teleport
FB
Send game invite to friend
Sharing Gameobjects over Photonetwork
Custom type Problem with serialization
void Awake()
{
PhotonPeer.RegisterType(typeof(WeaponDamageStruct), (byte)'S', WeaponDamageStruct.SerializaME, WeaponDamageStruct.DeserializaME);
}
public void ShootIng(WeaponDamageStruct WDS)
{
photonView.RPC("Damage", RpcTarget.All, WeaponDamageStruct.SerializaME(WDS));
}
public static byte[]SerializaME(object wds)
{
var WDS = (WeaponDamageStruct)wds;
byte[] Info = new byte[]
{
byte.Parse(Convert.ToString( WDS.Damage))
,byte.Parse(Convert.ToString( WDS.Jugador))
,byte.Parse(Convert.ToString( WDS.IdGun))
,byte.Parse( Convert.ToString( WDS.LookAt.x))
,byte.Parse( Convert.ToString( WDS.LookAt.y))
,byte.Parse( Convert.ToString( WDS.LookAt.z))
,byte.Parse( Convert.ToString( WDS.HitPoint.x))
,byte.Parse( Convert.ToString( WDS.HitPoint.y))
,byte.Parse( Convert.ToString( WDS.HitPoint.z))
,byte.Parse( Convert.ToString( WDS.Receptor))
,byte.Parse( Convert.ToString( WDS.HitSite))
,byte.Parse( Convert.ToString( WDS.MatType))
};
return Info;
}
oculus avatar sdk tutorial help
Unity Ball Syncronization
I am coding a animated ball multiplayer mobile game. The ball animation is quite fast (speed around 25-30) and there are 5 balls at the same time.
Initially, I tried to the physics are run on masterclient and synced in clients via pun2 network. However, the ball animation on the clients are not very smooth which will annoy the player.
Secondly, I tried to run each physics on each client separately with below function, however, the physics simulation is different between the android client and unity editor client.
Finally, what should I do?
The script on the ball;
Rigidbody rb; float t1 = 0.0f; float scale = 2f; float maxVelocity = 20f; bool collided = false; float limitSpeed = 30f; float cooldown = 1; void Start() { rb = GetComponent<Rigidbody>(); } void InitialKick() { switch (GameObject.Find("GameManager").GetComponent<GameManager>().ballCount) { case 1: rb.AddForce(new Vector3(20, 0f, 20), ForceMode.Force); break; case 2: rb.AddForce(new Vector3(-20, 0f, 20), ForceMode.Force); break; case 3: rb.AddForce(new Vector3(20, 0f, -20), ForceMode.Force); break; case 4: rb.AddForce(new Vector3(-20, 0f, -20), ForceMode.Force); break; case 5: rb.AddForce(new Vector3(10, 0f, 30), ForceMode.Force); break; } } private void FixedUpdate() { if (!collided) InitialKick(); if (collided & rb.velocity.magnitude < maxVelocity) rb.AddForce(3f * scale * rb.velocity.normalized, ForceMode.Force); t1 += Time.deltaTime; if (t1 > 1.0f) { scale += 0.5f; t1 = 0.0f; } rb.mass += Time.deltaTime * 0.01f; } private void OnCollisionEnter(Collision collision) { if (collision.collider.tag == "Wall" || collision.collider.tag == "Column") { collided = true; } } }
Custom Properties and Performance?
Hello,
How does the amount of properties impact performance? Does it just iterate/search through the values normally, or is there network implications for having large numbers of custom properties?
Thanks
[PUN2] Interest group not work
Player 1: #Unsuscribe from 1 PhotonNetwork.SetInterestGroups(new byte[0] { 1 }, null); #Unsuscribe from 2 PhotonNetwork.SetInterestGroups(new byte[0] { 2 }, null); #Suscribe to 1 PhotonNetwork.SetInterestGroups(null, new byte[0] { 1 });The second version have this code:
Player 2: #Unsuscribe from 1 PhotonNetwork.SetInterestGroups(new byte[0] { 1 }, null); #Unsuscribe from 2 PhotonNetwork.SetInterestGroups(new byte[0] { 2 }, null); #Suscribe to 2 PhotonNetwork.SetInterestGroups(null, new byte[0] { 2 });The third version doesn't have any code, this version is for Player 3 with InterestGroup zero. Then I connect to the same room and realize the test: Player 1 and Player 2 can listen Player 3. (That's expected because everybody listen to zero) Player 2 can listen to other Player 2. (That's expected) Player 1 can listen to other Player 1. (That's expected) Player 1 can listen to Player 2. (That's not expected because they belong to different interest groups) I can't figure out how to solve this problem. After searching, I found this: https://forum.photonengine.com/discussion/14829/interest-group-does-nothing There, @JohnTube said a line of code was missing but even adding that line the program doesn't have the expected test between interest groups. I don't know how to fix this or if @Slyp found a workaround. I can share my project if necessary.
My bullet damage myself~ help pls! thank!
My bullet C#
private void OnCollisionEnter(Collision collision)
{
if (collision.collider.tag == "Player")
{
PlayerData pd = collision.gameObject.GetComponent<PlayerData>();
pd.TakeDamage(DamageAmount);
}
}
I want to make bullet only damage on hit other player, but collision self don't .
(my bullet is a big fire ball, Shoot out from the body)
but my tag is same as other "Player"
cannot find answer... is someone can teach me?
THANKS!
Message fragmentation and PhotonNetwork.ObjectsInOneUpdate
Hi!. Is there a way to tell if a message is being fragmented? I'm under the assumption that it's based on the size of the byte stream that's being populated with my OnPhotonSerializeView's. But PhotonNetwork.ObjectsInOneUpdate is based on the amount of objects being sent rather than their size. If it is based on size, Is there a rough estimate as to what the size of this stream would be before fragmentation occurs? I am asking because I have a moderately large number of objects to send, but I know that their size is fairly small and I would like to increase ObjectsInOneUpdate.
TTL problems
Working on rejoin logic. I set TTL for the room to 5 minutes.
Works correctly if a player crashes or loses internet connection. But if they actually choose to quit the level and PhotonNetwork.Disconnect() is called, they stay in the level for 5 minutes still? That has to be a bug right? If not, i don't understand, how do i get the player to leave a level immediately? TTL should just be for handling unwanted disconnects right? Not intended disconnects?
PUN1 Latest, near to latest Unity.