- Home /
Network View mess up colliders?
I have a multiplayer game and it have come up an issue that i have posted befor but no realy awsner came up (http://answers.unity3d.com/questions/46911/i-cant-kill-the-other-player). I have tried to solve this my self and i what i know so far is when i add "Network View" to my bullet its dont hit the player. If i remove it the bullets dont fly off but just drop down to the floor but if i walk on them on my other player he lose life and can die.
I will send you the 2 code i use for thise 2 Objects:
function Update () {
if(networkView.isMine) {
if(bullitAmmo > 0)
{
if(Input.GetButtonDown("Shoot"))
{
var bullit = Network.Instantiate(bullitPrefab, transform.Find("spawnPoint").transform.position, Quaternion.identity, 0);
bullitAmmo -=1;
bullit.rigidbody.AddForce(transform.forward * bullitSpeed);
}
}
}
and
function OnControllerColliderHit(hit : ControllerColliderHit) { if(networkView.isMine) {
if(hit.gameObject.tag == "shot")
{
Debug.Log("Test: "+hit.gameObject.tag);
Statics.Life -= 5;
Destroy (hit.gameObject, 0);
}
}
}
Your answer
Follow this Question
Related Questions
Network view not attached 0 Answers
I cant kill the other player. 1 Answer
gameObject.find "Player" belonging to this network player??? 1 Answer
Bounds of players on screen 2 Answers