- Home /
Question by
im012 · Jul 19, 2017 at 03:17 AM ·
photoncollision detectionmultiplayer-networking
Two object with same script which will execute first ?
I have two game object with same script,which has OnCollisionEnter, i want only one game object which is moving fast to execute the script, How can i detect this ?
Comment
Best Answer
Answer by Reynarz · Jul 19, 2017 at 03:52 AM
You need a third object with an script... you can call it Referee.
/*Referee PseudoCode:
Find all objects with the tag that contains that script and put it in array.
Get their velocity by the property "velocity" that they are exposing.
Compare all velocities of the array, and send the value of true to the winner's bool property.
Objects pseudoCode:
Expose a property that contains my velocity.
Expose a property of bool type, if the value is true: execute the piece of code that you
need to be executed.*/
Your answer
Follow this Question
Related Questions
max players in orginal room 0 Answers
Photon Server vs Dedicated Master Client with PUN 1 Answer
Cannot Instantiate Player on PhotonNetwork 0 Answers
How to sync random number over network 0 Answers