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 ?
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.*/