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 multinfs · Sep 13, 2012 at 04:09 PM · cameramultiplayeraudiocar

Network Camera, Player

How can I have a main scene spawn a car on another game scene with each player having own cars that can shoot. I got it so far that I can drive and shoot and a Main menu. Its just the spawning that is the tricky part. It has gone all messed up a few times cuz of multiple audio listeners and the cameras switching to the other players car..

I got a script for network rigidbodies and a connect/disconnect script and a Instantiate(spawn) script for spawning cars/players.

I'd like that each player would have a different id so that the camera would know to what car it should follow. or something like that.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by Itinerant · Sep 13, 2012 at 05:04 PM

I was having a similar problem when I was trying to set up a Photon cloud game. My solution was to turn off the camera in the player prefab, then turn it back on when it was instantiated. This keeps it from linking the other players cameras. You can check out the steps I ended up using here:

http://answers.unity3d.com/questions/314232/activating-a-child-object-in-c.html

Comment
Add comment · Show 9 · 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
avatar image multinfs · Sep 13, 2012 at 05:06 PM 0
Share

Now, the camera doesnt get like updated or something cuz its just a grey screen, but I can see in the scene view that the car is there Edit: It wont enable the camera, I have no idea why it wont work. I have tried with GetComponent but nothing and there should be an .enabled to the camera object but it gives an error

avatar image Itinerant · Sep 13, 2012 at 05:11 PM 0
Share

It should. Just write a .enabled = true for wherever your camera is, and you should be good. I haven't fiddled around with the js commands for this particular solution yet (since Photon mostly uses C#), but I don't think the results should be any different.

avatar image multinfs · Sep 13, 2012 at 05:33 PM 0
Share

Hmm, Can't seem to get the camera Object itself, gonna c if I find a way.

avatar image multinfs · Sep 13, 2012 at 05:45 PM 0
Share

Well, I'm not sure but now I have only one car and each one that joins after get the same camera and cannot control the car..

avatar image Itinerant · Sep 13, 2012 at 05:49 PM 0
Share

That's strange...can you post the code that you're using to instantiate players onto the network?

Show more comments
avatar image
0

Answer by Meater6 · Sep 13, 2012 at 04:19 PM

Why not just have one of the scripts (or a new script) that is on a car have a variable called: playerNum, and just set it to an appropriate integer (player 1: 1, Player 2 : 2...), and make the camera find the right one.

Or an even better solution, include the camera in the car prefab so that it spawns with the right car from the start.

Hope this helps!

Comment
Add comment · Show 1 · 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
avatar image multinfs · Sep 13, 2012 at 04:36 PM 0
Share

I have a camera in the prefab but the problem is that the clients cam changes to the servers camera.. And about the number, How do I set it if I connect to the server from another scene and the spawning should work multiple times with same player?

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

11 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

Related Questions

Many Audio Listeners to multiplayer?? How? 1 Answer

Problem with Camera.ScreenToWorldPoint() on 2D Multiplayer 0 Answers

Laggy Camera 2 Answers

How to trigger camera capture on each player in Unity Networking? 0 Answers

Carcamera script raycasting fail ? 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