|
Hi, everyone Is there a script that when I click a certain object, the object should become new target of camera each time i click. i am using this code for camera. Thanx
(comments are locked)
|
|
I'm a bit new to Unity but i think I know a solution. (Sorry if it's not good) You should make the 'target' variable static in the orbit script, then put a script on the objects that are clickable: Hi, @Bazsee thanx for replay, i m also new to unity and c# and java. i understood second part but i don't know how to make static variable. in my camera orbit script. i need to make static variable, my camera orbit script is c# so, i m trying this, static var target; am i anywhere near to ans ? thnax
Mar 14 '12 at 09:22 AM
mandeep
try: static public Transform target; "static var target" is javascript
Mar 14 '12 at 09:29 AM
Bazsee
i tried this variable it's gives an error .. Unknown identifier: 'Guikeys'. The type i used this script on object function OnMouseDown () { Guikeys.target = transform.transform; } "Guikeys" is my camera orbit script name. thanx
Mar 14 '12 at 09:41 AM
mandeep
try changing: static public Transform target; to public static Transform target; (i wrote that down incorrectly before)
Mar 14 '12 at 09:51 AM
Bazsee
oh and make sure that the script on the object is not C# but JavaScript
Mar 14 '12 at 09:52 AM
Bazsee
(comments are locked)
|
|
try: static public Transform target; (or without the public tag, but i suppose you should leave that there) 'static var target' is javascript
(comments are locked)
|
