switch statement issue, any help?
hello unity coders, i am a c# student, not really beginner but i have some experience that make me more than a beginner a little, anyways, i have made a scene for testing my scripting skills, and i have decided to make a switch statement-based script, to switch between multiple game objects in-game, and there was 3 game objects to switch between them : cube, sphere, and capsule.
the problem is when i try to switch between them, i get an error message in unity says : - A switch expression of type `UnityEngine.GameObject' cannot be converted to an integral type, bool, char, string, enum or nullable type.
and thats the image of where the error is located : http://s16.postimg.org/66gbj929h/Screenshot_4.jpg
optional : whats the best way to make a gun move from a certain position to the aiming position? is it Vector3.MoveTowards? thank you all.
Your answer
Follow this Question
Related Questions
switch through switch cases forward and backward with pressing two buttons 0 Answers
The body of '' cannot be an iterator block because 'void' is not an iterator interface type??? 2 Answers
Coding Errors 1 Answer
A namespace cannot directly contain mambers such as fields or methods... 2 Answers
Flashlight script help! 2 Answers