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 asdf123 · Feb 05, 2014 at 10:38 PM · networkingphotonbulletweaponinherit

Network bullet issue

i have all working, i instantiate the bullet, and then if i hit an player, he loose life etc, but, when i shoot to the ground i dead, i think that my bullet is colliding with me, there is a way to make my bullet dont affect me? i tried to use ismine, but the bullet belong to everyone, so it dont work, there is a way to make my bullet dont hit my collider ? i cant find a way to my bullet search for who shooted the bullet, i dont want scripts, i want a explanation, please :D

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
0

Answer by NickP_2 · Feb 05, 2014 at 10:57 PM

Maybe this?

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

Answer by Void24 · Feb 05, 2014 at 10:58 PM

The way I handle this is by giving each player an ID. Then, each projectile gets an "ownerID" that corresponds to the shooter and is set when instantiated.

You can check an ownerID against the ID of the player hit to determine if the hit should be processed.

Furthermore, you can set an "arming timer" that removes the ownerID after a certain distance, similar to how bombs are armed a set time after being dropped by planes. This will allow the bullet to potentially bounce around and hit the shooter, if you prefer.

Comment
Add comment · Show 3 · 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 asdf123 · Feb 06, 2014 at 03:52 PM 0
Share

so, i have my bullet script, what's the script to check the ownerID ?

avatar image Void24 · Feb 06, 2014 at 04:45 PM 0
Share

I assume you have some sort of OnCollisionEnter event to kill a player on contact with a bullet?

If your player objects are already dying due to collision, just add a comparison before you destroy the player object. Compare the bullet's owner to the player. If they are the same, the player fired that bullet.

avatar image asdf123 · Feb 06, 2014 at 07:48 PM 0
Share

i've found a different solution. no i'm using raycast. but can you explain how i get the viewId of the player who instantiate the bullet ?

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

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

Related Questions

Photon (PUN) Type Serialization Error on RPC 2 Answers

Unity array out of range exception, using photon unity network. 1 Answer

How to instatiate two players simultaneoulsy before loading level 1 Answer

Photon networking 0 Answers

Smooth movement of non-player objects/vehicles over the network? (Photon) 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