|
Hi folks, i have 5 cylinder objects.. if i click on any one of cylinder the color should be changed and remain unchanged like wise for all those cylinders... how could i script for that?? i have already tried but no luck....
thanks in advance....sorry about my english...
(comments are locked)
|
|
Problem Solved [highlight object color] i have tried it with 2 scripts....same 5 cylinders and i noted with id's id=1,2,...5. its in first "cylinder.cs" script:
now we can control it with "GamePlay.cs" script:
thats it.... now it'll come like this, if you click of an object that particular only highlighted..remaining objects wont be highlighted... you may try it...if you have any doubts about it, share it with me.... thanks... This code doesn't even come close to compiling. It's hard to even tell what you're doing here.
Jul 23 '12 at 04:21 PM
Ben Blaut
(comments are locked)
|
|
//You may need to use raycasting to incidate if you have clicked an object in world space. hi lampshade.... ya i tried your script...i dont want all those objects changed the color...i just want if i click on a cylinder that particular only change as red....consider if i click on cylinder1 that only should be red..others are yellow.....if i click on cylinder2 all other changed as yellow and cylinder2 only as red...like this....have u got my ques now??? hope you understand well....
Feb 15 '11 at 12:50 PM
sriram90
lampshade's answer only for if you click on a object all objects color should be change....
Feb 17 '11 at 06:36 AM
sriram90
(comments are locked)
|
|
Take a look at the videos: Burg Zerg Arcade, teaches him to do so (in C #) and also a full RPG. To your question take a look at:
Links from tutorials: http://www.burgzergarcade.com/hack-slash-rpg-unity3d-game-engine-tutorial
(comments are locked)
|

So you want the color for all 5 cylinders changed to red when you click on any one of them? And it should change back to yellow when you release the button? Just trying to understand the question. ;)
nope spree...clicked cylinder only change the color to red..all others remains in yellow...if you click any one of them that particular cylinder color only to be change... hope you understand...
hi spree.... have you got my ques???
So I am a green. I click a cyl and they ALL Change to green? If I am a red, they all change from green to red?
Dont be confused with releasing the mouse button; just put code inside of OnMouseDown() for when you want something to happen when a mouse is clicked.