- Home /
Multiplayer Mouselook on Soldier (FPS)
Okay, I am trying to add in so that when you look down it other people see your soldier look down as well. I have two player versions, the first one is the one you see, the other is the one other players see. I have the MouseLook.cs that came with Unity on the soldier's Spine2. I am using the soldier from the asset store (not the bootcamp). I have a player handler that handles the soldier, first person view, and the scripts. Here it is...
#pragma strict
var fpsView : GameObject;
var tpsView : GameObject;
var Colliders : GameObject[];
var Guns : GameObject[];
var MouseLookS : Transform;
var MiniMap : GameObject;
function Start () {
Screen.lockCursor = true;
Screen.showCursor = false;
//Mine
if(networkView.isMine == true){
fpsView.active = true;
tpsView.renderer.enabled = false;
MiniMap.active = false;
for(var i = 0;i<Guns.Length;i++){
Guns[i].active = false;
}
for(var x = 0;x<Colliders.Length;x++){
Colliders[x].collider.active = false;
}
MouseLookS.GetComponent(MouseLook).enabled = true;
transform.GetComponent(MouseLook).enabled = true;
transform.GetComponent(FPSMovement).enabled = true;
transform.GetComponent(DisconnectButton).enabled = true;
transform.GetComponent(Sounds).enabled = false;
transform.GetComponent(FootStepSounds).enabled = false;
//Not Mine
}else{
fpsView.active = false;
tpsView.renderer.enabled = true;
MiniMap.active = true;
for(var q = 0;q<Guns.Length;q++){
Guns[q].active = true;
}
for(var l = 0;l<Colliders.Length;l++){
Colliders[l].collider.active = true;
}
MouseLookS.GetComponent(MouseLook).enabled = false;
transform.GetComponent(MouseLook).enabled = false;
transform.GetComponent(FPSMovement).enabled = false;
transform.GetComponent(DisconnectButton).enabled = false;
transform.GetComponent(Sounds).enabled = false;
transform.GetComponent(FootStepSounds).enabled = false;
}
}
I got it, I had active ins$$anonymous$$d of enabled/disabled to disable/enable the colliders and enable
Your answer
Follow this Question
Related Questions
Mouselook problem multiplayer. Synchronized in 2 computers. 2 Answers
How to handle movement in a multiplayer FPS? 0 Answers
Making a Model move with the Mouse 1 Answer
Can I change movement from Unity 3d into Unity 3D iOS 2 Answers
Issues with camera and player rotation scripts for basic FPS controller. 2 Answers