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 HSMInteractive · Nov 06, 2013 at 11:46 PM · photonnot-workingismine

photonView.isMine Problem [Help!]

So I'm trying to make it where only you can see your arms and stuff but not your character and other players can see your character but not your arms and stuff. This is my code so far (not all of it):

 using UnityEngine;
 using System.Collections;
 
 public class FirstPersonNetwork : Photon.MonoBehaviour {
     
     MouseLook cameraScript;
     MouseLook cameraScript2;
     CharacterMotor controllerScript;
     Shot shotScript;
     public GameObject camera;
     public GameObject fpsView;
     public GameObject tpsView;
 
     void Awake () {
         
         cameraScript = GetComponent<MouseLook>();
         cameraScript2 = camera.GetComponent<MouseLook>();
         controllerScript = GetComponent<CharacterMotor>();
         shotScript = GetComponent<Shot>();
         
          if (photonView.isMine == true)
         {
             this.camera.camera.enabled=true;
             cameraScript.enabled = true;
             cameraScript2.enabled = true;
             controllerScript.canControl = true;
             shotScript.enabled=true;
             fpsView.active = true;
             tpsView.renderer.enabled = false;
         }
         else
         {           
             this.camera.camera.enabled=false;
             cameraScript.enabled = false;
             cameraScript2.enabled = false;
             controllerScript.canControl = false;
             shotScript.enabled=false;
             fpsView.active = false;
             tpsView.renderer.active = true;
         }
 
         gameObject.name = gameObject.name + photonView.viewID.ID;
     
     }

However, when I test it, I can still see my character.

This is my setup:

FPS Controller (script attached to this) ----FPS Camera ----3rd Person Model

camera = FPS Camera fpsView = FPS Camera tpsView = Character Model

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 ggunhouse · May 01, 2014 at 02:34 PM 0
Share

I'm trying to do the same thing, but without success. None of the demos I've found uses a first-person viewpoint (view from eyes of player). Can anyone point me to one that does?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by supamigit · Jun 08, 2014 at 02:47 PM

Well isnt it more to do with the placement of the FPS camera that is embedded in the prefab of the player?

ie im doing Quils tutorial and made slight changes because i could see his head like i was inside it... not a good look

PlayerController (prefab that comes with Unity) - Top level stuff

- Transform -

  • no changes

- Character Controller -

  • Center Y to 1.001 (to make sure it doesn't start in the ground Radius of 0.36

PlayerController/Camera - Second level items

Transform-

  • Y to 1.66 gives the right head height (up/down)

  • Z to 0.15 give the right
    forwardness to stop looking through
    the face (forward/back)

Everything beyond that i left what it was, i am using the Soldier character from assets store with base firstperson prefab and then made those changes above to allow the camera not to show the HEAD like i was inside it... now for the body and arms im not 100% sure what you mean.. Hope this was something along the lines of what you needed..

Comment
Add comment · Share
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

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

18 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 avatar image avatar image avatar image

Related Questions

Keypress.ismine? 0 Answers

UNITY Scripting - True and False not working! 3 Answers

Compiler errors when opening unity 0 Answers

Custom Editor Window not opening after layout crash 1 Answer

how do i get the viewid of the object that my prefab collided with? PhotonNetwork 1 Answer


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