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
1
Question by ak1617 · Aug 10, 2012 at 12:22 AM · multiplayerphotonviewmeshrendererinvisible

How to make enemy players invisible using Photon?

Im working on a multiplayer top down shooter using Photon Cloud. I'm trying to make it so that all enemy players are invisible (meshRenderer = false) unless they are in your vision cone (which I have implemented and is working using raycasts). I'm new to photon and networked multiplayer in general so if anyone could offer some advice on how to go about this it would be awesome. I guess more specificlly my question is about how to make certain meshrenderers enabled from certain players views and disabled for others. Hope that makes sense and thanks a lot

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 tobiass · Aug 10, 2012 at 08:51 AM 0
Share

As you said yourself, this is not really a network-related question. Once the positions are updated through the net, the core of your question is still open.

In general: You would need a list of all players and their positions. As first step, define a range how far you can see at all. Compare ever other player's distance to you against this threshold and then disable the renderer if the player is too far away.

1 Reply

· Add your reply
  • Sort: 
avatar image
1

Answer by Nanity · Aug 10, 2012 at 09:15 AM

I guess you mean how to solve the following issue:

Client A says: Hide player C because he's out of range (playerC.meshRenderer = false) Client B says: Hey, but player C is in MY range, so make him appear (playerC.meshRenderer = true)

The solution would be simply not to sync your visibility state over the network. Just send his actions, not his point of view.

In case you want to implement an alert function (Player X is aiming at Player Y), let PlayerX send a message over the network to PlayerY that he's been discovered. Like detectedPlayer.applyAlertAction(this.playerID) or similar.

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

9 People are following this question.

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

Related Questions

Photon / Multiplayer - Bootcamp Demo 3 Answers

max players in orginal room 0 Answers

Animation does not work for the remote player 0 Answers

Multiplayer Position Sychronization problem in unity2d 1 Answer

Operation failed: OperationResponse 226: ReturnCode: 32758 (Game does not exists) 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