• 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
Question by benk0913 · Jan 17, 2013 at 04:22 PM · collisioninstantiateplayernetworkphoton

Bullet wont collide for the other player (PHOTON+UNITY)

Ive been working on a flamethrower as one of my weapons. Its a platform multiplayer online game. It is also working with photon. I am having a problem with the flames(and the other rifles bullets too). THe flames which the flamethrower shoots are being instantiated with PhotonNetwork.Instantiate... And they do collide with the player which instantiated them, and the other player is able to see them instantiated and their movement. But for some reason the player which instantiates them sees who they collide to and sees them collided but the other player which is shot at wont see the flames collided with himself or with the walls. The flames own their script of collision and movement and a photonView component.

What do I do to solve this issue?

Comment

People who like this

0 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 benk0913 · Jan 18, 2013 at 01:44 PM 0
Share

Does anybody knows?

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by benk0913 · Jan 30, 2013 at 01:14 PM

PROBLEM SOLVED - Had to put a rigidbody on the bullet. :)

Comment

People who like this

0 Show 2 · 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 arthurptj · Nov 16, 2015 at 01:55 AM 0
Share

Could you post your code pretty please? I am working on a similar game and i'm very stuck.

avatar image $$anonymous$$ arthurptj · Dec 03, 2015 at 08:17 PM 0
Share

You want a basic shooting script that works and a bullet mover? (Be sure to compare how other tutorials show their versions so in the future you can tweak them more to your liking.)

Add to Empty Game Object and name it shoot or ShotSpawn, Just for organizing. (Also get your shot sound cause you will attach an Audio Source to it,

 using UnityEngine;
 using System.Collections;
 using System;
 
 public class Shoot : MonoBehaviour
 {
     public GameObject bullet;
     public float delayTime = 1;
 
     private float counter = 0;
 
     void Start()
     {
     }
 
     void Update()
     {
 
         if (Input.GetKey(KeyCode.Mouse0) && counter > delayTime)
         {
             Instantiate(bullet, transform.position, transform.rotation);
             GetComponent<AudioSource>().Play();
             counter = 0;
         }
         counter += Time.deltaTime;
     }
 }
 

Put this one on the bullet itself in scene and then drag it back in you assets as a prefab with the script attached. It will destroy the clones after 6 seconds,

 using UnityEngine;
 using System.Collections;
 
 public class MoveBullet : MonoBehaviour
 {
 
     public float speed = 20.0f;
 
 
     // Use this for initialization
     void Start()
     {
 
     }
 Good luck.
     // Update is called once per frame
     void Update()
     {
 
         transform.Translate(0, 0, speed);
         Destroy(this.gameObject, 6);
     }
 
 }
 

Remember, the Shoot Script goes on the Empty Game Object you rename Shoot, ShotSpawn or whatever and place in front of the point where the bullet comes out of (or Bolt, or Coconut or Egg, it does not matter what THE BULLET Object is called in this case).

You make the Bullet Itself and save it with the script in your assets,. You delete te bullet from the Scene where you build stuff. On the Shot Spawn point you drag the prefab object to the part where it says "bullet" on the Shoot Script,.

Looks like this as examples.

alt text

alt text

untitled.jpg (354.0 kB)
making-the-bullet.jpg (397.0 kB)

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

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

Instantiating random prefabs when the player passes through a trigger 1 Answer

Network two players collision 2 Answers

Needs help to instantiate camera as child of player 0 Answers

Photon Player resets to 0,0,0 0 Answers

Network.Instantiate players at each spawnpoint? Don't use the same spawnpoint? 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