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 VirtualJunky · Jul 22, 2013 at 10:51 PM · cameraphotonissue

Photon and UFPS Camera Issue

In UFPS (Ultimate FPS) the Camera(s) are attached to an Empty, which is then connected to the player prefab, if you separate them, you get a tonnnn of bugs popping up, in other words, the camera is hard-coded to always be attached to the player prefab.

The reason this is an issue for me, is Photon. Every guide I come across shows how to set this up, with the camera being a standalone thing. So, I'm not sure if this is even possible, cause I'm new to all this.

Here is how it's normally done:

 GameObject playerObj = PhotonNetwork.Instantiate("PlayerPrefab", new Vector3(114f, 105f, -90f), Quaternion.identity, 0);
 vp_FPCamera camera = playerObj.GetComponent<vp_FPCamera>();
 camera.enabled = true;

So, my question is, is it possible to code something to look at a sub-object component, instead of the base level of the object?

I have PlayerPrefab > FPSCamera > vp_FPCamera script component. My current code above only looks at PlayerPrefab for 'vp_FPCamera'.

Any help here would be greatly appreciated. Thanks. :)

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 steffenbrem · Jan 19, 2014 at 03:19 PM 0
Share

I'm also facing the same problem, any insight in a solution would be great :)

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by xt-xylophone · Jan 20, 2014 at 02:28 AM

You cannot get the vp_FPCamera from the playerObject, you need to get it from the camera child of that object.

If I remember off the top of my head, the Camera object of the PlayerPrefab is just called "Camera"?

So you could do this:

 GameObject playerObj = PhotonNetwork.Instantiate("PlayerPrefab", new Vector3(114f, 105f, -90f), Quaternion.identity, 0);
 vp_FPCamera camera = playerObj.FindChild("Camera").GetComponent<vp_FPCamera>();
 camera.enabled = true;
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

17 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

Related Questions

Photon room name issue 0 Answers

[Solved] Camera issue - Do not see camera icon in scene 1 Answer

camera.RenderWithShader not working in 5.1.0f3 0 Answers

Weird issue with clamp on Rotation 1 Answer

Get the collider component of a child element 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