Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Samuel411 · Oct 10, 2013 at 12:39 AM · movementmultiplayerfpsmouselook

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;
      }
 }
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Samuel411 · Oct 10, 2013 at 01:32 AM 0
Share

I got it, I had active ins$$anonymous$$d of enabled/disabled to disable/enable the colliders and enable

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

15 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges