- Home /
Question by
user-12151 (google) · May 01, 2011 at 11:19 AM ·
collisionrandom
Make a random choice on collision enter - c#
Hi there, being new to Unity I'm struggling to find a good way of doing the following.
On collision enter of a certain game object, I want either a random script to be enabled (from a set of scripts I define) or put all the scripts in to one file and a random choice of which case to use is made.
Does anyone have any pointers or code samples of how I could achieve this? preferably in c#.
Comment
Answer by user-12151 (google) · May 01, 2011 at 12:38 PM
Solved this just with a case statement and random number range :).
Your answer
Follow this Question
Related Questions
Semi-Controlled Array Randomization 1 Answer
Collision Detection is too slow 0 Answers
Edit - Code isolation using random ID numbers C# 1 Answer
Destroy Bullet on Random Collision 0 Answers
Help moving turret shoot lasers 2 Answers